JS tests generated
implementation of the js function