I liked this bit of JavaScript trivia from Cassidy Williams.
Look at this JavaScript code:
let [CLOSED, OPEN] = [{}, {}]; CLOSED = { cake: OPEN, }; OPEN = { fish: 5, }; console.log(CLOSED); // cake is {}
Code language: JavaScript (javascript)Why is it that
CLOSED
is not{ cake: { fish: 5 }}
?
There is a clear answer, and it’s something worth making sure you understand before heading into a job interview that involves JavaScript.