how to create if else statement in javascript