Avoiding JavaScript Type Conversion Issues - How Type Coercion Works

Поделиться
HTML-код
  • Опубликовано: 14 апр 2020
  • In JavaScript, like generally in programming, you work with data - with values. And these values have different types. JavaScript requires certain types for certain operations and also freely converts between types. This can lead to unexpected behaviours - so here's how JavaScript type coercion works (and what it is).
    Learn all about the core "tricky parts" of JavaScript: acad.link/js-tricky
    And/ Or learn JavaScript from the ground up - all the way to expert level: acad.link/js
    I also have another summary video about the "tricky parts": • Making Sense of the Tr...
    Check out all our other courses: academind.com/learn/our-courses
    ----------
    • Go to www.academind.com and subscribe to our newsletter to stay updated and to get exclusive content & discounts
    • Follow @maxedapps and @academind_real on Twitter
    • Follow @academind_real on Instagram: / academind_real
    • Join our Facebook community on / academindchannel
    See you in the videos!
    ----------
    Academind is your source for online education in the areas of web development, frontend web development, backend web development, programming, coding and data science! No matter if you are looking for a tutorial, a course, a crash course, an introduction, an online tutorial or any related video, we try our best to offer you the content you are looking for. Our topics include Angular, React, Vue, Html, CSS, JavaScript, TypeScript, Redux, Nuxt.js, RxJs, Bootstrap, Laravel, Node.js, Progressive Web Apps (PWA), Ionic, React Native, Regular Expressions (RegEx), Stencil, Power BI, Amazon Web Services (AWS), Firebase or other topics, make sure to have a look at this channel or at academind.com to find the learning resource of your choice!

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

  • @phantom7132
    @phantom7132 4 года назад +19

    Correction at 8:42: Objects are not primitve types but reference types. I'm sure it was a fluff :-) Thanks Max!

  • @dibaliba
    @dibaliba 4 года назад +13

    This video is just awesome about JavaScript coercion, haven't seen such a detailed and easy to learn video about this topic.

    • @sunghahhwang7747
      @sunghahhwang7747 4 года назад

      I am not impressed since this is just Max being Max

  • @gianluca.g
    @gianluca.g 4 года назад +22

    *_C/C++ programmers left the chat_*

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

    Man this is the best video I've seen which clearly explains coercion.

  • @ntarunmenon1
    @ntarunmenon1 4 года назад +1

    Thank you Max for this excellent video. I gained some new insights into javascript.

  • @kirant9339
    @kirant9339 4 года назад +1

    As usual your videos are amazing,Thanks Max. I thought this topic is difficult but watching your video and way of your teaching is excellent.

  • @godlerner
    @godlerner 4 года назад +3

    Hi Max! Great video! Love your courses! At 8:43 you are saying that objects are primitive types. Sorry for the correction, I know it was just a tiny confusion.

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

      Ya this is his tong slip he cleared it at 8:50 Objects are not primitive they are reference type values store in Heap memory.

  • @gopinathkrm58
    @gopinathkrm58 4 года назад

    Thanks Max all you tutorials are awesome.

  • @dhaneshdhanawade
    @dhaneshdhanawade 4 года назад +1

    Very good 👍, I am looking for this video in details...

  • @952a259
    @952a259 8 месяцев назад

    Very nice and helpful video, thanks!

  • @user-gu5ts5nx8r
    @user-gu5ts5nx8r 4 года назад

    Very helpful. Thanks for sharing.

  • @mohamedboushab40
    @mohamedboushab40 4 года назад +1

    It's really helpful thanks

  • @renata4727
    @renata4727 3 года назад

    Awesome, thank you!

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

    12:38 - thats absolutely valid js expression

  • @ProgramWithBalaji
    @ProgramWithBalaji 4 года назад

    Great video Max

  • @nerdophile6945
    @nerdophile6945 4 года назад

    Great Video, now I can bully my juniors !!

  • @rutvikshah4589
    @rutvikshah4589 4 года назад

    Congratulations 500k 🙏😍😎

    • @academind
      @academind  4 года назад

      Thank YOU and so many others for making this possible :)

  • @sachin-vi6wh
    @sachin-vi6wh 4 года назад

    Please can you explain why undefined == null is true

  • @webdecodedwithfahad4414
    @webdecodedwithfahad4414 4 года назад

    Congratulations 🎉 500k 💓 Subscribers

    • @academind
      @academind  4 года назад

      Just amazing and just possible because of the awesome support we get from you and many others :)

    • @webdecodedwithfahad4414
      @webdecodedwithfahad4414 4 года назад

      @@academind See you on 1M💓 You Deserve It :-)

  • @kajalahuja982
    @kajalahuja982 4 года назад +1

    Hey bro ... Thank you for such awesome content.
    But i have one doubt . Can you please help me in that
    I wanted to know the reason that why { } + [ ] is not equal to [ ] + { } in javascript.

    • @SuperNZY
      @SuperNZY 3 года назад

      it is actually equal, try a console.log( {} + [] == [] + {}) // true
      "object Object" + "" === "" + "object Object"
      "object Object" + empty string(nothing) ==/= empty string(nothing) + "object Object"

  • @front-endanimal6359
    @front-endanimal6359 4 года назад

    i very love your tutorial

    • @academind
      @academind  4 года назад

      Thank you! 😊

    • @front-endanimal6359
      @front-endanimal6359 4 года назад

      @@academind wow, you answered me. WOW, man, i love your course about python and web dev. I watched all of these. Thank you for you job. I will to teach people web dev in my channel how you!

  • @ProgramWithBalaji
    @ProgramWithBalaji 4 года назад +3

    When can we expect your Algorithm course?

    • @academind
      @academind  4 года назад +5

      Working on it but as always we never share any release dates before the release is fix.

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

      @@academind You can do a early release. Because, since it's a lockdown time, we have dedicated time to learn. So, if possible do a early release. Please....

  • @msvmanikantasrivishnu7788
    @msvmanikantasrivishnu7788 4 года назад

    best best best..max is the best

  • @Alex-xw5bc
    @Alex-xw5bc 4 года назад +1

    Can you make a video about vue native? I haven't really seen anyone talk about it

  • @ooo1558
    @ooo1558 4 года назад

    What do you advise me
    Flutter or React native

    • @academind
      @academind  4 года назад

      Please check this video => academind.com/learn/flutter/react-native-vs-flutter-vs-ionic-vs-nativescript-vs-pwa/

    • @noshadb.e3111
      @noshadb.e3111 4 года назад +1

      that video is mostly "it depends..." type of video, but use React native why? because whatsapp facebook instagram IMDB Quara Twitter use it and you dont look like next mark zukker berg to me

  • @gkmishra2009
    @gkmishra2009 4 года назад

    Give video on angular CDK

  • @gkmishra2009
    @gkmishra2009 4 года назад

    Give video on all operator of RXJS

  • @gkmishra2009
    @gkmishra2009 4 года назад

    Give video on highchart

  • @davidjustice2323
    @davidjustice2323 4 года назад

    When the LEGENDARY Maximilian speaks out, all pple must carefully listen! Love you my favourite tutor.

  • @Microphunktv-jb3kj
    @Microphunktv-jb3kj 4 года назад +2

    .... and that's why typescript is hyped.

  • @codito7388
    @codito7388 4 года назад

    Really nice job. I would like to answer you a couple of things. I created a professional website for my sister's husband with react js and the only thing that i have for back-end is the contact form which has been created with node-nodemailer. Can i host both front-end and back end somewhere and what do you suggest? Also how to make seo in react?

    • @maskman4821
      @maskman4821 4 года назад

      Next.js takes care of ssr, seo and pwa. don't build your project with create-react-app, it only takes care of front-end(static files); Same with vue, use Nuxtjs to develop projects !!!

  • @indiaview7725
    @indiaview7725 4 года назад

    Hello Dear sir, I am a hybrid application developer. I work at ionic framework . I want add live video streaming in my app.please make a playlist on live video streaming in ionic .

  • @moinakhter2474
    @moinakhter2474 4 года назад

    Hello max plzz make a video that why we can change objects even we declare them as const thanks in advance

  • @eugenenovikov671
    @eugenenovikov671 4 года назад

    Eeleven! Freedom! Scotland!

  • @joey8395
    @joey8395 4 года назад +4

    Javascript looks dumber to me by the minute...
    Can someone tell me where the benefits lie in this mess? (for devs)

    • @Chisegh
      @Chisegh 4 года назад +1

      There are no benefits. Javascript originally wasn't designed to be a language for developers. As far as I know some of these decisions were made to make the language easier to use for non developers. Since then, Javascript has grown to be a widely used language, but sadly we are still stuck with all the design decisions that were made in the beginning.

    • @noshadb.e3111
      @noshadb.e3111 4 года назад +1

      the benefits is use correct type before using Operators asshole! computer is not your slave to do all the things for you learn to pull your weight too
      and in future JavaScript will rule all the language more than it does now
      so watch your tongue when you are speaking of JavaScript

  • @AyushSingh-mb6xd
    @AyushSingh-mb6xd Год назад +1

    why false == "false" is false

  • @webdecodedwithfahad4414
    @webdecodedwithfahad4414 4 года назад

    Angular or React What You Prefer Please Answer 😊

    • @academind
      @academind  4 года назад

      academind.com/learn/angular/angular-vs-react-vs-vue-my-thoughts/

    • @webdecodedwithfahad4414
      @webdecodedwithfahad4414 4 года назад

      @@academind Really love you bro Already bought your Angular and Node Courses 💓

  • @SirMorak
    @SirMorak 4 года назад

    Is it really necessary to know all that ? Isn't it better to always use === ?

  • @gkmishra2009
    @gkmishra2009 4 года назад

    Give Video on NGRX in angular with deeply understanding

  • @paulfontaine7819
    @paulfontaine7819 4 года назад

    I am a computer. For me, 1 + 1 == 10; 1 + 1 != 11

  • @nocode659
    @nocode659 4 года назад +1

    Upload the tricky part course in udemy

  • @kikaen
    @kikaen 4 года назад +1

    There's one easy way to avoid this, use TypeScript instead.