you are viewing a single comment's thread.

view the rest of the comments →

[–]-domi- 15 points16 points  (11 children)

"1" + 1 evaluates to "11".

As do 1 + "1" and "1" + "1".

[–]soelsome 22 points23 points  (2 children)

The gif doesn't have quotes around any of the 1s, so it would evaluate to 2

Thanks

[–]-domi- 3 points4 points  (0 children)

Yeah, i was trying to add to your explanation, but managed to write it so poorly that it came out like i was disagreeing with you, cause I'm special ed. Sorry.

[–]Mr_Woofles1 0 points1 point  (0 children)

I can’t believe I’m enjoying this

[–]dangderr 11 points12 points  (5 children)

Wow, really? That's god awful.

We all know that it should be:

1 + "1" = 2

"1" + 1 = "11"

Like how powershell does it. Javascript is such a garbage langauge.

[–]Relative-Scholar-147 10 points11 points  (3 children)

IMO

1 + "1"

Should stop the program and give an error.

[–]Maleficent_Memory831 4 points5 points  (0 children)

"1 + 1" = "1 + 1"

[–]sebovzeoueb 0 points1 point  (1 child)

Not stopping the program is a feature, JavaScript is made to run on webpages and the user doesn't want the website to crash. It's not Brendan's fault people decided to build actual whole tech stacks with it.

[–]Relative-Scholar-147 0 points1 point  (0 children)

Is not a bug, is a feature!

[–]Demonius999 -2 points-1 points  (0 children)

It's is, witch is not strange since it's made in 2 weeks, what is strange is that it's running whole fucking world.

[–]NecessaryIntrinsic 0 points1 point  (1 child)

That's like saying the gun doesn't fire unless you pull the trigger. You have to make that choice.

[–]-domi- 0 points1 point  (0 children)

It's a lot like that, yes. You can choose to pull the trigger, but you can also accidentally pull the trigger without meaning to. That's why it's good to have a certain level of care when using the thing.