@pratiksharm
Well, thank you for opening a good discussion. I am afraid its technically not a good idea to call everything in JS an object. Even though we've got object wrappers to make certain methods work flawlessly on primitives, its still better to keep the difference well lit. Such assumptions can lead to mistakes where someone would try assigning a property to some primitive expecting it to be retrievable which in this case will misfire :)
Correct. 5 !== new Number(5). Values and references aren't exactly the same. For most purposes, you can treat everything like an object in JS, but it's nuanced.
I'm Calin Baenen – AKA KattyTheEnby – a programmer born October 30th, 2006.
I love programming, it has been my passion since I was a kid, and will forever be my passion.
I'm Calin Baenen – AKA KattyTheEnby – a programmer born October 30th, 2006.
I love programming, it has been my passion since I was a kid, and will forever be my passion.
@pratiksharm Well, thank you for opening a good discussion. I am afraid its technically not a good idea to call everything in JS an object. Even though we've got object wrappers to make certain methods work flawlessly on primitives, its still better to keep the difference well lit. Such assumptions can lead to mistakes where someone would try assigning a property to some primitive expecting it to be retrievable which in this case will misfire :)
Correct.
5 !== new Number(5). Values and references aren't exactly the same. For most purposes, you can treat everything like an object in JS, but it's nuanced.I mean, primitives get
Objectmethods, so....@baenencalin Hey! I just tried to make this a little more clear in this post
I see. And it's a great post.
:)