Shorthand operator in Javascript
The Ternary Operator
const answer = x > 10 ? "greater than 10" : "less than 10";
Short-circuit Evaluation Shorthand
const variable2 = variable1 || 'new';
const answer = x > 10 ? "greater than 10" : "less than 10";
const variable2 = variable1 || 'new';
In this page (written and validated by A. Gawali) you learned about . What's Next? If you are interested in completing Javascript tutorial, we encourage you simply to start here: Javascript Tutorial.
Share On: |