some code for  JS  examples