helpers functions for general javascript usage, and functional javascript usage