Email or username:

Password:

Forgot your password?
Top-level
Artemesia

@h

I was poleaxed the first time I saw the !!! javascript operator, and then researched it and learned it's actually useful in context. Fuck ECMA-script. Second worst thing in the software world, after Windows.

6 comments
Hazel :pleadingcat:

@artemesia idk what youre talking about with triple exclamation? thats just the same as one-
!true == false
!!true == true
!!!true == false

Artemesia

@h

The first two !! do a type conversion to binary. The third inverts the binary value. The combination lets you do a C-style conditional of "not that, whatever it is".

I wish I didn't know this, and I wish javascruff wasn't such a shitty language.

Hazel :pleadingcat:

@artemesia this isnt part of the language. this is an engine optimisation

Hazel :pleadingcat:

@artemesia before wasm engines had things like this to make javascript run faster by being able to make much more drastic optimisations

Hazel :pleadingcat:

@artemesia you try it??? it does the same thing as one exclamation point as far as a dev is concerned?

Go Up