Remix.run Logo
falcor84 7 hours ago

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

TheOtherHobbes 6 hours ago | parent [-]

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
bryanrasmussen 6 hours ago | parent | next [-]

NaN is a standardized dynamic languages datatype governed by IEEE 754, this is not something to complain about as its behavior is part of the official standard and for good reason, as outlined in the standard.

SonOfLilit 4 hours ago | parent [-]

Why dynamic? `NAN != NAN` is just as true in C.

bryanrasmussen 2 hours ago | parent [-]

well as I understood it, it was implemented for languages without static data typing although I suppose you could implement it in other languages.

Also I suppose my memory could be pretty foggy as I don't think I've looked at the spec since about 2014.

flufluflufluffy 3 hours ago | parent | prev | next [-]

None of those examples are showing something you find wrong with the syntax

lezojeda 6 hours ago | parent | prev [-]

[dead]