Just why, /g/?
>>54579992
learn how to objects and the difference between string compare and integer compare
>0777
In every decent language prefixing a number with 0 means it's base 8, 0777 is actually 511
Two empty arrays not being equal is completely fine because they are two different objects with different memory location.
0777 being larger than 800 and 600 is also false in real world because 0777 is 511 in octal notation.
I don't even like JS but try harder with your bait next time.
>ugh
kys faggot
>>54580023
>In every decent language prefixing a number with 0 means it's base 8
C was the JavaScript/PHP of its time.
>>54580023
That happens in literally no language ever.
>>>/reddit/
>>54580038
>>54580023
Nice samefag, retard.
>>54580196
No, php is web c but even less rules
>>54580196
No, it was the java of its time.
>slow as balls
>buggy as shit
>impossible to write stable software with it
>high-level and bloated
>worse than pretty much everything else currently available in every possible way
Even better:{} + []
> 0
[] + {}
> "[object Object]"
>>54580199
>That happens in literally no language ever.
It happens in a lot of languages but a lot of them have also switched to "0o" notation instead to make it less vague.
>>54580267
Oh yeah:{} + 3
> 3
3 + {}
> "3[object Object]"
>>54580283
>but all of them only ever had
FTFY
>>54580244
This, mesa, CPL and various Algol was better.
>>54579992
At least the first two are actually pretty logical, anon.
>>54580327
I can understand[] == []because it's comparing them by identity, but[] == ![]being true makes no sense at all. ![] evaluates to false. It also means [] sometimes acts like true and sometimes acts like false.
>>54580430
Silly me, I read !==. You're right of course.
>>54580430
the jit probably just compiles to []!=[]
>>54580063
this picture just gave me 90's nostalgia. Anyone else? Looks like one of those Disney movies kek
>>54580267
>>54580309
>{} + []
+[] is 0
automatic ; insertion makes that into {}; +[], thus 0.
>[] + {}
+ joins the array with ',' then appends the rest, treats {} as object literal and converts to string
>{} + 3
Also works with {}+"3"(=3) and doesn't with {}+"a"(=NaN)
same auto semicolon bullshit removes the {} part, and then an unary plus tries to convert shit to number
>3 + {}
converts both to string
The "{} + shit" isn't really an issue because it doesn't happen with variables, and the rest kind of makes sense.
Can you guys post all them images you have of the guy holding the degree with the bad code at the side.
Nothing gets me like those.
>>54580327
>This, mesa, CPL and various Algol was better.
The real problem is that schools don't teach these languages. People say C strings are "character arrays" but C strings aren't safe because it doesn't have real arrays.
It wasn't 0 vs 1 based, but 0 vs arbitrary lower bounds with 1 as a default. Fortran, BASIC, Algol 60/68, PL/I, Pascal, Ada, and so on allowed arbitrary lower bounds and had multidimensional arrays too.
Some students today believe that that null-terminated strings were an improvement over other kinds of strings.
>>54581850
Fuck C strings though
I'd rather do them manually instead of their arbitrary rules.