Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 286 Bytes

wtf.js-assignment.md

File metadata and controls

20 lines (14 loc) · 286 Bytes

wtf.js: Assignment

#javascript #wtf

Example 1:

let x = 2;
console.log(7 * (x = 3)); // logs 21

Example 2:

let a, b, c, d;
a = b = c = d = 5;
console.log(a + b + c + d); // logs 20

These work because assignments return the assigned value.