First of all, nice video! and then, there're a couple that have explanation. For instance, ['1', '3', '11'].map(parseInt), the second argument of parseInt is in which base will take to do the conversion, I think by default is base 2 so 1 => 1, of course and 11 => 3, and finally, 3 in binary system does not exist that's why NaN. Another that I dare to explain is, 3 > 2 > 1 = false, (3 > 2) true (true is equal to 1) 1 > 1 (false) so true and false, false. It's quite confusing haha but understandable. See you! have a good day.
Not really, in JavaScript, this statement is equivalent to 1 > 1, but in Python this statement is actually equivalent to 3 > 2 and 2 > 1, which returns True
what is weird on that object + x is not a number? .1 + .2 = .3000... not just in javascript, it's in any programming language that stores floating point number as 1.X * 2 ^ n typeof NaN (not a number) being a number might seem strange, but it's just part of the object, which other object should it be under? 3 > 2 > 1 also not weird, works like this: 3 > 2 returns true, that is equal to 1, 1 > 1 is false... that is weird just to bad programmers. typeof null being object is same as NaN, null is used when something should return object, but there is nothing to be returned 999... being 100... is the same thing as .1 + .2, javascript stores everything as double hence the moment number is too large, it has to round it the rest is the stuff I watched this for
You are of course correct, but you could argue this way for pretty much all things in this video. All of the explanations are available at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
I was trying to point out mainly the stuff that is not just the javascript stuff, there are 3 main rules in JS that cause all the weird stuff - rule 1 is everything except undefined is object, rule 2 is javascript first tries to do operation on objects themself, if unsucessful, than try to cast, and than throw error, and rule 3 I forgot while I was writing this, but I know there was one more important thing to remember :D
@@PhilipFabianek about "typeof null // 'object'", from my understanding is that all types in javascript is stored as 32bit values, and they use the last 3 bits to describe the type of the data. and NULL is 32 bits of zeros, which unfortunatly makes the last 3 bits all being zeros.. which is the same type that is used to say its an object. So its an old bug that still exists in JS
actually you need to use isNaN() function. Its not only javascript that does this. and why is it like this? According to IEEE 754 specifications any operation performed on NaN values should yield a false value or should raise an error.
Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
type of NaN ('Not a Number') -> number: I laughed so hard on this.
as a person who dont code in Js, this f my brain up so hard
what's a dev's favourite food?
ToFoo.
Where does he like to eat it?
At a ToFoo Bar
What is Love? Javascript don't hurt me, don't hurt me, NaN
Subbed, love your style of content man
It's not weird, it's just beautiful, looking forward for your explanation.
Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
@@PhilipFabianek thanks for the explanation
First of all, nice video! and then, there're a couple that have explanation. For instance, ['1', '3', '11'].map(parseInt), the second argument of parseInt is in which base will take to do the conversion, I think by default is base 2 so 1 => 1, of course and 11 => 3, and finally, 3 in binary system does not exist that's why NaN. Another that I dare to explain is, 3 > 2 > 1 = false, (3 > 2) true (true is equal to 1) 1 > 1 (false) so true and false, false. It's quite confusing haha but understandable. See you! have a good day.
Full explanations are available at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
1:00 'fun'
JavaScript is weird. That is why I love it
Best Programming Content Maker
Not sure about that but thank you!
JavaScript is weird 100% true but i love it 😁😁
0:38
Wouldn't that one happen in most languages? For how I understand it, this statement checks if 1 is larger than 1.
Not really, in JavaScript, this statement is equivalent to 1 > 1, but in Python this statement is actually equivalent to 3 > 2 and 2 > 1, which returns True
i would build a programming language where null + null = 1, but null * 2 = null
what is weird on that object + x is not a number?
.1 + .2 = .3000... not just in javascript, it's in any programming language that stores floating point number as 1.X * 2 ^ n
typeof NaN (not a number) being a number might seem strange, but it's just part of the object, which other object should it be under?
3 > 2 > 1 also not weird, works like this: 3 > 2 returns true, that is equal to 1, 1 > 1 is false... that is weird just to bad programmers.
typeof null being object is same as NaN, null is used when something should return object, but there is nothing to be returned
999... being 100... is the same thing as .1 + .2, javascript stores everything as double hence the moment number is too large, it has to round it
the rest is the stuff I watched this for
You are of course correct, but you could argue this way for pretty much all things in this video. All of the explanations are available at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
I was trying to point out mainly the stuff that is not just the javascript stuff, there are 3 main rules in JS that cause all the weird stuff - rule 1 is everything except undefined is object, rule 2 is javascript first tries to do operation on objects themself, if unsucessful, than try to cast, and than throw error, and rule 3 I forgot while I was writing this, but I know there was one more important thing to remember :D
I am curious 🧐?
alr budy 0.1+0.2 happens on any languange !
Yes of course i would!!!
Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
Come on, tell me why
Ain't nothin' but a heartache
yes i want
The answers are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
@@PhilipFabianek about "typeof null // 'object'", from my understanding is that all types in javascript is stored as 32bit values, and they use the last 3 bits to describe the type of the data. and NULL is 32 bits of zeros, which unfortunatly makes the last 3 bits all being zeros.. which is the same type that is used to say its an object. So its an old bug that still exists in JS
yes, sure
You can find the explanations at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
javascript is confusing in mindustry: Groups.player.getByID().kick("reason",seconds*1000)
yes for sure!!!!!!!!!!!!!
Yes❤
Yes.. Explain
You can find the explanations at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
@@PhilipFabianek thanks a lot
JavaScript is Not Weird, there is a reason behind it.
yup!
Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
nope
yes!!!
You can find the explanations at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
Yesss 😀
That's why Javascript was written in 10 days
I think NaN === NaN is false because you need to use strict types like NaN == NaN(JS is weird)
actually you need to use isNaN() function. Its not only javascript that does this. and why is it like this? According to IEEE 754 specifications any operation performed on NaN values should yield a false value or should raise an error.
yeah 😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂
LOL:)))))))