FFS JavaScript is the worst creation mankind has ever come up with. HOLY FUCK
Why would anyone bring such a terrible blasphemy to such popularity. JavaScript together with PHP are objectively
the worst languages to learn ever
'5' - 32
Well, okay... Dynamic typing and implicit conversion.
'5' + 3'53'
Who the fuck would allow the previous one with '-' if the '+' operator has been overloaded with custom string functionality?!
'5' - '4'1
Well i guess the devs were implicit conversion fetishists >:C
'5' + + '5''55'
W-WTF IS THIS. WHY WOULD YOU NEED A UNARY '+' OPERATOR (the second '+')
'foo' + + 'foo''fooNaN'
AAAaaaAAAaaAaAaAaAAHhhhhhhHHHHHHHHHhhhhhhhhhh
'5' + - '2''5-2'
The same implicit shit again. But I have to admit not as crazy as some previous ones...
'5' + - + - - + - - + + - + - + - + - - - '-2''52'
NOW IT'S TOO FAR! NOBODY CAN JUSTIFY THIS MONSTROSITY. THERE IS OBJECTIVELY NO POSSIBLE REASONING FOR THIS GARBAGE
var x * 3;x has now the value of 0
WHO WOULD EVEN ALLOW THIS SYNTAX WITHOUT ERRORS?! WHAT DOES THAT EVEN MEAN
Okay, I get the thing with type-ignoring comparison and strict with the '===' operator. But I CANNOT COMPREHEND THE AMOUNT OF IMPLICIT CONVERSIONS TAKING PLACE HERE. HOW THE FUCK IS ANYONE SUPPOSED TO WRITE SERIOUS CODE?!?!
I guess you could design a new language which compiles to javascript (pyscript could benefit from that until it maybe becomes the new standard, WHICH WOULD BE AWESOME), if the standard doesn't accept anything other than javascript. That way you just would have to put a lot of thought into the compiler...
5 + []'5'
Well okay... Empty array converted to string is logically an empty string, so nothing changes...
{} + []0
Okay now it's getting kinda insane with this implicit conversion madness. Empty Objects and arrays having a value of 0???
0 - {}NaN
WE FUCKING JUST SAW THAT AN EMPTY OBJECT HAS A VALUE OF ZERO. WHY WOULD THIS NOW RESULT IN NaN??!??!?!?
{} - 0-0
WHY DOES THE FUCKING 'ORDER' MATTER HERE?!?! AND WHO THE FUCK WOULD GIVE ZERO A NEGATIVE AND POSITIVE VERSION (looking angrily at you, IEEE754)
(![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]'fail'
HOLY MOTHERFUCKING CRAP I AM LOSING MY MIND WITH THIS SHITPILE OF A LANGUAGE. I DON'T KNOW HOW TO USE WORDS ANYMORE HJADHJSAJHD ASD THIS IS COMPLETE INSANITY WHY WHY WHY WHO EVER THOUGHT USING THIS HORRIBLE ABOMINATION ON THE INTERNET. NO WONDER SO MANY BEGINNERS MAKE CRAPPY CODE!! BECAUSE THE FUCKING PROBLEM LIES AT THE CORE, THE FUCKING LANGUAGE ITSELF ADFHUA234SDHJUGAS GD(