add func def in js