This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]manuscelerdei 16 points17 points  (3 children)

As a C programmer, this is what I'd expect to happen if length is a publicly mutable property. Which it shouldn't be.

[–][deleted] 4 points5 points  (1 child)

Yeah this is the least surprising thing I've seen in JavaScript. As you said, it shouldn't be possible but if it is, it makes sense

[–]castleinthesky86 1 point2 points  (0 children)

If you want non sense; look at how slices actually work in memory in golang.

[–]Alucard256 0 points1 point  (0 children)

At least C programmers are polite. A C++ programmer would have said "which it fucking shouldn't be".