Using Logical Operators To Perform Ternary Operations In Javascript