JavaScript Quiz: Variable in Array

By Xah Lee. Date: . Last updated: .
JavaScript quiz variable in array 2015-08-09
JavaScript quiz variable in array
// js quiz. what the following print.
const x = "a";
const r = [3,x];
x = "b";
console.log(r);

const y = [2];
const r = [3,y];
y[0] = 4;
console.log(r);
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

Ask me question on patreon