logoalt Hacker News

falcor84today at 1:44 PM1 replyview on HN

The syntax? I got 99 problems with js, but syntax ain't one of them. It's just C-style syntax, no?


Replies

TheOtherHobbestoday at 2:54 PM

C syntax was never that great. It's basically mnemonic PDP-11 assembler with a few added data structures.

js is mutant C with dementia - hacked together over over a fortnight, full of inconsistencies and weird corners.

    console.log(1 + "2"); // "12"
    console.log(1 - "2"); // -1
    console.log(NaN === NaN); // false
    console.log(+0 === -0); // true

    const obj = {};
    console.log(obj.foo); // undefined, not an error
show 3 replies