how to create a function in javascript (1)