結果 : how to write if then statement in javascript