3 ms·
const x = (1, 2, 3) // 3 x === (1, 2, 3) Javascript's tuples have some great compression!
by always_good 9y ago
const x = (1, 2, 3) // 3
x === (1, 2, 3)
Javascript's tuples have some great compression!
- yorwba 9y agoWhen I was just a neophyte, I wondered whether JavaScript supported multidimensional arrays, so I wrote array[x, y] = something and it appeared to work (reading array[x, y] returned the written value, after all). It was only when I tried to store multiple values with the same y-coordinate that I realized my mistake.