Message from JavaScript discussions
September 2017
— The problem is hasOwnProperty
is slow on objects, but what about Arrays? Maybe index in arr
is faster
Oki guys, a question for you without looking up the reason.
null > 0 //false
null === 0 //false
null >= 0 //true
Why
— Coercion, null coerces to false and false coerces to 0, that gives answer to 1 and 3
— === checks value as well as type
— Null == 0 is false as well.
— null == 0
but typeof null != typeof 0
,
Edit: null != 0
— Null != 0, cool
— Don't know why though, need to have a look
— I hadn't even thought of it. Came to know of it from a blog a friend had written. Thought you guys would like to know :)
— Https://blog.campvanilla.com/javascript-the-curious-case-of-null-0-7b131644e274
The blog. Not a plug.
— When you use Object.getOwnPropertyNames(array)
you actually know 'something' (even undefined) is on that position.
— How slow is that