Guest User

Untitled

a guest
Jul 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // the agility of javascript's ternary operation...
  2. // lots of folks don't seem aware of the subsequent assignments available
  3.  
  4. function ternary(a,b) {
  5. var c,d,tis='';
  6. c = (d = a==b) ? tis='tis true' : tis='tis false';
  7. return [c,d,tis];
  8. }
  9. console.log(ternary(true,true));
  10. console.log(ternary(true,false));
  11. console.log(ternary(false,false));
Add Comment
Please, Sign In to add comment