JavaScript simple if statement - print yes -


 if (2<3), console.log (yes) 

this not work. how can fix this? want print "yes" if true if not console.log, should be?

there few errors code:

  1. you have remove , because invalid syntax.
  2. you need add quotation marks around word yes make string.

you code should this:

if (2<3) console.log ('yes') 

then should see 'yes' printed in console.


Comments