Attached: lol.png (425x167, 9K)
JS Shenanigans
James Howard
Jayden Taylor
>==
cringe
Chase Cooper
What's wrong with this?
Carter Davis
weak typing bad
Leo Cook
>==
brainlet detected
Dominic Turner
>==
At least learn what you're doing.
Carter Young
OP's brain is too small to handle dynamic languages.
Julian Smith
There's literally nothing wrong with this, just use === if you don't wanna deal with it. When using == with operands of different types (with the exception of null and undefined) they're compared as if they were converted to Numbers.
Parker Bennett
Oh and for String to Boolean conversion, the empty string is falsy and any other string truthy.
Anthony Russell
this but unironically
Jordan Ross
Imagine using a language so shitty that you need an equals operator as well as a "no really, I mean equals" operator.
Angel Flores
ddddddumbass
Hunter Gutierrez
>More than two equals
>More than two genders
JSfaggots confirmed for tranny enablers.
Jaxon Wood
What "==" is supposed to do in JS?
Lincoln Bailey
It's a poorly implemented Python == that leads to the sort of results you might expect from a language whose core was completely developed in 10 days.
Jose Wilson
Comparison with type coercion.
Leo Sullivan
It's a comparator that works between types.
Christopher Wood
Luke Thomas
>0 is false
>1 is true
>any string is true
How is this bad? I'm sure most if not all languages do this
Joseph Jones
how is "\t" == 0? is it because it's white space?
Tyler Lopez
>I literally cannot comprehend what a subset is
Anthony Anderson
For String to Number conversion whitespace is stripped first and the empty string is converted to 0.
Jordan Richardson
When you say
>Python ==
you are saying that JS mimics what "==" Python do?
LOL, that's kind weird, what do you guys use to compare the same kind of type?.
Logan Gomez
Falsy and truthy; disgusting
Blake Brown
From the tutorial:
An equality check converts values using the numeric conversion (hence "0" becomes 0)
Blake Rodriguez
>what do you guys use to compare the same kind of type?
===
Lucas Wright
absolutely niggerlicious
Brandon Brown
Name a single positive thing about this that is relevant to people with triple digit iq's
Isaac Wilson
([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+!+[]]]+(![]+[])[+[]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]
the above is a fun little example
Jayden Sullivan
You can compare things simply without having to bother with changing types.
>b-but if you have a triple digit IQ then its easy to change the types and then compare them!
Or I could just not.
Caleb Gonzalez
> alert
> this new language I'm learning doesn't do things like the last one
oh no
Aiden Torres
>literal reddit spacing
>also literally retarded
pottery
Henry Price
If they have the same type then it doesn't matter whether you use == or === or do you mean to see if two values have the same type?
Evan Wright
WEAK TYPING BAD
Ayden Johnson
>being a low IQ web dev
This is the reason you people come up with a new framework every month but all of them are equally shit.
Charles Jenkins
>also literally retarded
said a fucking animetard
Colton Thomas
alert([] == ![]); // > true
Nathan Reed
This is why TypeScript exists
Isaiah Lewis
LOL my question doesn't make sense, if it is the same type it really doesn't matter, but then the following question bugs my mind: why do JS have "==" and "==="? The "==" should not exist, because it's not the same type.
Parker Bell
([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]
Christian Kelly
What I mean is on a very high level the concept of == in JS and Python seem to be seeking to accomplish the same ends, but JS version is completely unusable and worthless.
David Bell
>i have no apples in my bag
>i have no bag at all
both cases you still have no apples
Carson Ward
But undefined
Andrew Robinson
Fuck TypeScript. Pros are waiting for the next-level language that compiles down into TypeScript.
John Reed
>quoted cuckold deletes his post
oh nonononono
Leo Morris
>Let's just build on a shitty foundation instead of digging it up and laying a sound one.
I hate the argument in favor of transpiled JS derivative shitlangs almost as much as I hate JS itself.
Jonathan Sanchez
What is this JS gutterlang pilpul?
Samuel Richardson
alert(Boolean([]) == Boolean(![])); // > false
Jack Morgan
>completely unusable and worthless
Agreed
Owen Reyes
But theres no sign ever that this Javashit problems are going away in the future standards. Typescrupt is your best bet
Joshua Hughes
JS should be forcibly removed from the standards by government intervention.
Samuel Jenkins
>be a redditor
>fuck up Jow Forums formatting because of the brain damage
>use the delete post function to "edit" your post
>still use reddit spacing
Bentley Taylor
JavaScript's problems will never go completely away because browsers need to maintain backwards compatibility. They can be replaced with better alternatives though, which is already happening, just don't use any of the older features and JavaScript is actually a pretty decent language in practice.
Brandon Gray
Well that proves it, c# is clearly better! -retarded enterprise developers who can't write javascript.
Jose Hernandez
All these problems have gone away you retard. Just press = one more time. You stupid kids have 0 knowledge of programming.
David Murphy
The entire language was honked from the start. It should be replaced. Its golden calf status is bullshit.
Andrew Young
Great completely empty argument with no facts you stupid kid. You just repeat the same shit you hear from some other stupid person.
Just use === if you want strict comparison. That is what all good programmers use by default. You can even set it to warn you when you use something else with eslint if that is your thing. But you dumb fucking kids pretending to be experts on the internet don't know shit about anything.
Joshua Wood
=== looks gay
Xavier Martin
Anybody in this thread defending javascript needs to fuck off back to whatever bootcamp they came out of.
Kayden Foster
>N-no you can never replace the language completely designed and implemented in 10 days! It’s not fair! We invested so much time building sandcastles!
Hudson Diaz
Only because you're imagining it as a penis larger than your own.
Josiah Wright
What kind of person enthusiastically learns JS? Everyone who has used a real programming language wants to vomit when they realize what they would be dealing with if they decided to use it.
Easton Morris
Yeah, no, you can't because the whole internet is built on it. Tens of years of website content that relies on JS to run won't ask for your permission to exist.
Eli Russell
>Yeah, no, you can't because the whole internet is built on it. Tens of years of website content that relies on Flash to run won't ask for your permission to exist.
Gabriel Wright
>thinks he can build something like v8 in 10 days.
>doesn't understand what an ecosystem is.
>thinks he can replace the millions of javascript libraries easily
>thinks it is easier to do this then press = one more time on the keyboard.
Fucking retards.
Kayden White
Evaluate
['1','2','3']. Map(parseInt)
And be amazed
Logan Price
> I literally cannot tell the difference between equality and identity
Xavier Torres
It's not really that amazing once you realize that #map passes multiple arguments into the callback
Eli Bennett
For me there's more of an incentive to build shit with JS. I suppose it's because a lot of things are visual or interactive. For the longest I've been stuck in tutorial/book hell with other languages, but I actually do things with JS. Maybe it's meant for retards like me, so that's pretty good. The language lacks coherent design throughout but you can get around most things I've found so far, so it's not that big of a deal. Why does JavaScript's warts bother you faggots so much but bring up the flaws of Unix or C and you turn to apologetics? Both Unix and C have introduced a large mass of cancer, C alone is largely responsible for the 'security' industry.
Ethan Taylor
Because Jow Forums only likes autistic things. The only languages Jow Forums likes are as close to the metal as possible, anything else is impure, inconsistent, not minimalistic enough.
So if you ask them, they hate C++, they hate Java, they hate C#. The only thing that Jow Forums autists appreciate is C and assembly. That's all. Nothing else.
Jow Forums are basically the wahhabists of programming. Except the lame, socially awkward version of it.
Charles Watson
The idea is typescript can me mapped to other languages and not just JS one day. Check out Deno.
Andrew Morgan
>I'm not knowledgable to make any arguments criticizing javascript so I'm just gonna call you a shit programmer instead
Sounds like you should learn 2 code and come back in a year or so.
Jace Peterson
I'm a C++ and Javafag and I hate JSWebdevs more than retards with C hacker syndrome.
Julian Gray
Then you're a boomer.
Jaxson Thompson
For references that use pointer semantics, == compares identity, because the identity of what is being referenced, and the underlying value of the referece are semantically the same, that of the address of what is being referenced.
For references and values that do not use pointer semantics, == should compare value.
the only languages that have this problem are the ones that have to hide the concept of pointers to help retards
Juan Hill
I hate that an empty list defaults as truthy (instead of false).
let arr = [];
if (arr) { // arr is truthy so this branch works
console.log(true)
}
It's so annoying, and I swear JavaScript is one of the only languages where this happens.
You have to do
let arr = [];
if (arr.length) {
console.log(true)
}
instead.
Adrian Butler
Watch me faggot. Browsers will be destroyed and I will create a new standard in three days.
Easton Stewart
You could just do:
Boolean([]);
Aiden Johnson
>muh ecosystem
>implying javascript libraries are irreplaceable and 95% of them aren’t a bunch of useless tranny bloat
Zachary Jackson
eat a tidepod
Ayden Turner
>Sunkcost fallacy
Fuck off kike. Your software is shit and should literally be illegal.
Jayden Morgan
You think calling an object wrapper to test a boolean is necessary just for a conditional statement? arr.length is better than Boolean(arr) , but it's stupid JavaScript cannot automatically detect the truthiness of an empty list.
Adrian Harris
use C# faggots
or at least Lua or Python
Samuel Hughes
> I dont need shortcuts to make my code smaller
Need to compare user input with a number?
Yeah just do
```
try{
int num = atoi(user_inp);
if(user_inp == mynum) doshit();
}
catch{
//oh no the user input was bullshit and not a num
throw UserAnIdiot;
}
Kevin Thompson
I don't know how to code block
Don't judge me.
Bentley Long
>weird mix of C and C++ style code
>using exceptions
>unironically advocating for non-static typing because muh development time
I am judging you, but not because of that.
I'm not even sure what you meant by this, what does this even have to do with the fact that obfuscating pointers is bad and that identity of a type should always be calculated by an explicit equality check of a reference type with pointer semantics rather than an equality check of what acts like a non-reference type with value semantics but is actually just a pointer under the hood?
Owen Cruz
And what do you think happens when you wrap it in an if statement?
Andrew Lewis
I love deno
Jordan Barnes
>The entire language was honked from the start
This non-argument seems to be your best argument because I read it at least 10 times in this thread.
James Phillips
You really are a retard. It is not cost but existing value what the user was talking about. Read an economics book maybe?
Hudson Lewis
JS is not valuable in itself retard. The websites are. Of course a retard like you thinks the JS IS the product. Fuck you and die.
Cooper Rodriguez
>I don't know how == works in JS, but complain anyway general
Caleb Ramirez
I think you're misunderstanding, my point is the branch if statement works, not the body of the if statement. E.g.
let arr = [];
if (arr) { // arr is truthy so this branch works
// do this
}
Jacob Allen
so?
1) cast int(0) to bool = false
2) cast object, non-empty string to bool = true
3) compare int to string, which is done literally = true
are you somewhat retarded, OP?
you can do operators in C++ behave the exact same way with your custom classes,
even your own string class that could behave *exactly* like this