> be me
> work on project in node
> use "this" to refer to the current object
> "this" doesn't refer to the current object
MDN:
> A function's this keyword behaves a little differently in JavaScript compared to other languages.
> In most cases, the value of this is determined by how a function is called.
I did not know this language was objectively bad.
>not knowing fucking basic quirks of a language you're using
Let me guess, first website after learning node at coding camp?
fun.call(this, ...args)
But yes, JS is a piece of shit.
You're a piece of shit too for blogging here.
>>56158426
Pretty much everything "behaves a little differently in JavaScript compared to other languages" because it's a steaming pile of fucking shit designed in literally 10 days.
>>56158470
JS consists of nothing but quirks waiting to blow up in your fucking face at runtime. There is no other language that bad. Even PHP is the definition of sanity and good design in comparison.
>>56158630
>because it's a steaming pile of fucking shit designed in literally 10 days.
I could design something better in 2 days. Hell, most of /g/ could. Eich was simply incompetent.
>>56158426
I'm sorry that you're a pleb who doesn't know jack shit about javascript.
Stay classy, OOPcucks.
>>56158426
Actually this makes complete sense when you consider the asynchronous nature of how functions and callbacks work. You're just shit at it mate.
> all numbers are ieee 754
>>56158630
>tfw when there's nothing wrong with PHP if you're not a retard and use it properly.
>>56159747
"Fun" fact: all numbers in JS are 64-bit, except before _any_ bitwise operation they're truncated to 32 bits, then the result is converted back to 64 bits again:1 << 31 == -2147483648; // true, JS fags will defend this
>>56159776
I actually quite like PHP, but you have to be one delusional motherfucker not to see its quirks and warts.
>>56159347
This.
>>56159975
Yeah, there are plenty of things that can go wrong with PHP if you don't use it properly, and I doesn't have any problem at all with people going full retard.