JavaScript is Weird

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 52

  • @PhilipFabianek
    @PhilipFabianek  2 года назад +7

    Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

  • @juzarbharmal9998
    @juzarbharmal9998 Год назад +19

    type of NaN ('Not a Number') -> number: I laughed so hard on this.

  • @minhnguyen-q1z7w
    @minhnguyen-q1z7w 7 месяцев назад +2

    as a person who dont code in Js, this f my brain up so hard

  • @AniishAu
    @AniishAu 2 года назад +7

    what's a dev's favourite food?
    ToFoo.
    Where does he like to eat it?
    At a ToFoo Bar

  • @niksatan
    @niksatan 2 года назад +12

    What is Love? Javascript don't hurt me, don't hurt me, NaN

  • @habui4149
    @habui4149 2 года назад +5

    Subbed, love your style of content man

  • @venkatv3208
    @venkatv3208 Год назад +10

    It's not weird, it's just beautiful, looking forward for your explanation.

    • @PhilipFabianek
      @PhilipFabianek  Год назад

      Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

    • @venkatv3208
      @venkatv3208 Год назад

      @@PhilipFabianek thanks for the explanation

  • @lucas.contreras89
    @lucas.contreras89 Год назад +6

    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.

    • @PhilipFabianek
      @PhilipFabianek  Год назад +1

      Full explanations are available at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

  • @Garfield_Minecraft
    @Garfield_Minecraft 2 месяца назад +2

    1:00 'fun'

  • @saadmehmood1992
    @saadmehmood1992 2 года назад +20

    JavaScript is weird. That is why I love it

  • @TajAlasfiyaa
    @TajAlasfiyaa 2 года назад +4

    Best Programming Content Maker

  • @vickrammark2082
    @vickrammark2082 2 года назад +5

    JavaScript is weird 100% true but i love it 😁😁

  • @Jolfgard
    @Jolfgard Год назад +1

    0:38
    Wouldn't that one happen in most languages? For how I understand it, this statement checks if 1 is larger than 1.

    • @PhilipFabianek
      @PhilipFabianek  Год назад

      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

  • @mr.duckie._.
    @mr.duckie._. 8 месяцев назад +1

    i would build a programming language where null + null = 1, but null * 2 = null

  • @sgmvideos5175
    @sgmvideos5175 11 месяцев назад +1

    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

    • @PhilipFabianek
      @PhilipFabianek  11 месяцев назад

      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/

    • @sgmvideos5175
      @sgmvideos5175 11 месяцев назад +1

      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

  • @Dipenparmar12
    @Dipenparmar12 2 года назад +1

    I am curious 🧐?

  • @hamzacasdasdasd
    @hamzacasdasdasd 4 месяца назад +1

    alr budy 0.1+0.2 happens on any languange !

  • @alharethturab7612
    @alharethturab7612 Год назад +1

    Yes of course i would!!!

    • @PhilipFabianek
      @PhilipFabianek  Год назад

      Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

  • @dxcqcv
    @dxcqcv 2 года назад +3

    Come on, tell me why

    • @PelpsRoxXx
      @PelpsRoxXx 2 года назад +1

      Ain't nothin' but a heartache

  • @maherkarot9129
    @maherkarot9129 2 года назад +1

    yes i want

    • @PhilipFabianek
      @PhilipFabianek  2 года назад

      The answers are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

    • @AndrewTSq
      @AndrewTSq 2 года назад

      @@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

  • @jitu11
    @jitu11 2 года назад +1

    yes, sure

    • @PhilipFabianek
      @PhilipFabianek  2 года назад

      You can find the explanations at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

  • @andreymitrichev6552
    @andreymitrichev6552 Год назад +1

    javascript is confusing in mindustry: Groups.player.getByID().kick("reason",seconds*1000)

  • @ramshankarkumar4222
    @ramshankarkumar4222 2 года назад +1

    yes for sure!!!!!!!!!!!!!

  • @gnaneshnayak4592
    @gnaneshnayak4592 10 месяцев назад +1

    Yes❤

  • @excalibur2506
    @excalibur2506 2 года назад +2

    Yes.. Explain

    • @PhilipFabianek
      @PhilipFabianek  2 года назад +1

      You can find the explanations at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

    • @excalibur2506
      @excalibur2506 2 года назад +1

      @@PhilipFabianek thanks a lot

  • @VarunJain15
    @VarunJain15 10 месяцев назад +1

    JavaScript is Not Weird, there is a reason behind it.

  • @amirrahnama8104
    @amirrahnama8104 Год назад

    yup!

    • @PhilipFabianek
      @PhilipFabianek  Год назад

      Full explanations are available here: www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

  • @sharonye8297
    @sharonye8297 6 месяцев назад +1

    nope

  • @jack19820814
    @jack19820814 2 года назад +1

    yes!!!

    • @PhilipFabianek
      @PhilipFabianek  2 года назад +1

      You can find the explanations at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/

  • @kumarashutosh4080
    @kumarashutosh4080 2 года назад +1

    Yesss 😀

  • @Serzes_
    @Serzes_ Год назад +3

    That's why Javascript was written in 10 days

  • @jcgamer1650
    @jcgamer1650 2 года назад +1

    I think NaN === NaN is false because you need to use strict types like NaN == NaN(JS is weird)

    • @AndrewTSq
      @AndrewTSq 2 года назад +1

      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.

  • @techhype3453
    @techhype3453 2 года назад +1

    yeah 😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂

  • @barnabasszabolcs8708
    @barnabasszabolcs8708 2 года назад +1

    LOL:)))))))