Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
neeno31465yThe "title" of the log message might've been evaluated before the elements were removed from the array. Then when you expand the log the items of the array have already been removed, but the "title" of the log message hasn't been updated. That's my guess on it.
-
morphplay365y@ItsaMeTuni is spot on. It happens all the time. If you want an exact output of an array at an exact point in time, you can log it as a string.
-
Read the god damn information bubble!!!!!!
Gotta teach this like every fucking junior -
crisz81915yArrays in JavaScript don't exist, they're just plain object which have the length property, number as keys and the Array prototype.
You can create arrays also like this:
function HomeMadeArray() {
this[0] = 'abc';
this[1] = 'def';
this.length = 2;
}
HomeMadeArray.prototype = Array.prototype;
new HomeMadeArray(); // ['abc', 'def'] -
It's just that the length property is independent of the number of elements but items being added to the array handles the increment/decrement
Related Rants
Can anyone tell me what the fuck is going on here?
rant
wtf
js