Re:Are You a JavaScript Guru? Try This Test
by nirvanatikku on Saturday February 02, 2013 @02:12PM
(#5156936)
Surprised to see people claiming that this isn't essential knowledge. Understanding what the system is doing at its core allows you to answer these questions; as 'tricky' as they may seem. If you're dealing with JS, you should know how things are working under the hood. There shouldn't be any memorizing, instead, you should be able to reason what the outcome is in those cases. At least that's what I strive for.
[ Parent
| on HN ]
Re:Are You a JavaScript Guru? Try This Test
by politician on Saturday February 02, 2013 @03:07PM
(#5157136)
Agreed, knowing how 1/x behaves for x in [null, 0, void 0] is helpful. Specifically, don't expect a "div by 0" error to be thrown. Instead, check for infinity. That's not something a C# developer would necessarily expect.
Re:Are You a JavaScript Guru? Try This Test
by svachalek on Saturday February 02, 2013 @04:28PM
(#5157395)
Yes, unfortunately many languages have borrowed C's rather bizarre ideas about what's permissible. 1/0 should crash but it's perfectly okay for 0xffffffffu + 1 to give different answers depending on your architecture.