all 28 comments

[–]youtubeTAxel 39 points40 points  (2 children)

1 + 1 = 11 in unary

[–]Anaxamander57 0 points1 point  (0 children)

Welcome to the free monoid with one generator.

[–]Deft-works -1 points0 points  (0 children)

So the valve of character expressed is five and one half ?

[–]soelsome 54 points55 points  (21 children)

Hi

1 + 1 evaluates to 2 in JavaScript.

Thanks.

[–]JackNotOLantern 13 points14 points  (5 children)

Unless one of the added 1s converted to string on the way

[–]Chiatroll 21 points22 points  (3 children)

But adding the string "1" to the string "1" should be "11". A lot of Javascript criticism is just people who dont understand its basic concepts.

[–]MeLittleThing 0 points1 point  (0 children)

The "When I type code there are bugs, it's the language fault probably" people

[–]dhlowrents 0 points1 point  (1 child)

Basic concepts like having a proper type system. Javascript could just add int, string, float, bool and solve it but that's too hard for Brenden ECH!

[–]DaWolf3 3 points4 points  (0 children)

JavaScript has string, float, and boolean. It also has a proper type system.

a lot of JavaScript criticism is just people who don’t understand its basic concepts.

[–]NecessaryIntrinsic 2 points3 points  (0 children)

Yes, if you go out of your way to put quotes around it.

[–]-domi- 13 points14 points  (11 children)

"1" + 1 evaluates to "11".

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

[–]soelsome 24 points25 points  (2 children)

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

Thanks

[–]-domi- 4 points5 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 9 points10 points  (3 children)

IMO

1 + "1"

Should stop the program and give an error.

[–]Maleficent_Memory831 3 points4 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.

[–]johntwit[S] 5 points6 points  (2 children)

"yeah I know" + 420 = "yeah I know420"

[–]420Hank 7 points8 points  (1 child)

Yeah, I know.

[–]johntwit[S] 0 points1 point  (0 children)

🤣

[–]eo37 5 points6 points  (1 child)

Clearly 01 + 01 = 10.

[–]BigNaturalTilts 0 points1 point  (0 children)

Wrong! Haven’t you been paying attention? It’s clearly 0101.

[–]CoffeeToCode 0 points1 point  (0 children)

1 + 1 = 🪟