How To Use Nested If In Javascript