17 Pro JavaScript tricks you didn???t know

JavaScript : Tricks You Should Know

The ternary operator

Noobs:

let hungry = true;
let eat; 
if (hungry === true) {
       eat = 'yes'; 
} else {
       eat = 'no';
}

Pro:

let hungry = true;
let eat = hungry === true ? 'yes' : 'no';

Read More

Tags: JavaScript