[js] - change the function format