Explain yourselves javascriptcels

40
Jump in the discussion.

No email address required.

Here's the thing. You assigned a property called '0.5' to an object that happens to be an array, then asked for the count, which is 3. If you want to update an array like you said they're not the same thing. You can do the same logic with a function object, it's valid. :marseywholesometrans:

let func = function () {};
func['you'] = 1;
console.log(func.you); // 1
Jump in the discussion.

No email address required.

You assigned a property called 0.5 to an object that happens to be an array

You shouldn't be allowed to do that.

:marseyindignant:

Jump in the discussion.

No email address required.

coulda :marseysockpuppet: shoulda :drafts: woulda :marseywould:

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.