Javascript Get Functionobject Based On A True