Day ...oops

Not gonna make any excuses. Except for the fact that it was the holidays and I’ve been traveling nonstop. Thats not an excuse its more of a jusitification - big diff.

Anyway TIL two things

Thing 1
The difference between apt and apt-get

Thing 2
array.length is not only writable but will truncate the array if you set the length to be shorter than the current length.

let myarr = [1,2,3,4,5]
# undefined
myarr
#[ 1, 2, 3, 4, 5 ]
myarr.length
#5
myarr.length = 2
#2
myarr
#[ 1, 2 ]

omfg.

But wait there’s more

myarr = [1,2,3]
# [ 1, 2, 3 ]
myarr.length = 6
# 6
myarr
# [ 1, 2, 3, <3 empty items> ]
for (let x of myarr) { console.log(x) }
# 1
# 2
# 3
# undefined
# undefined
# undefined

Okay.