added key-value named function for javascript