Posted By

brianyang on 08/29/10


Tagged


Versions (?)

Conditional Assignment


 / Published in: JavaScript
 

  1. var a = 1;
  2. var b = (a == 1) ? 2 : 1;
  3. console.log('b is now = 2')

Report this snippet  

You need to login to post a comment.