4.5. Expressions and Evaluation¶
/*If you ask JavaScript to print an expression using console.log,
the interpreter evaluates the expression and displays the result.*/
console.log(1 + 1);
//2
4.17
6
/*Since evaluating an expression produces a value, expressions can
appear on the right-hand side of assignment statements.*/
let sum = 1 + 2;
console.log(sum);
//3
Thank you!
6
0
Are there any code examples left?
New code examples in category Javascript