Understanding Immutability in JavaScript

Поділитися
Вставка
  • Опубліковано 25 чер 2024
  • We often hear the terms: immutable and immutability. What do they mean and, as developers, why should we care?
    In this video, we look at immutability of primitives, arrays, and objects with JavaScript examples. And we enumerate why immutability is important for programming.
    Links
    JavaScript Code: stackblitz.com/edit/immutabil...
    Content
    00:00 Understanding Immutability in JavaScript
    00:43 Primitives in JavaScript: Naturally Immutable
    02:10 JavaScript Array are Mutable
    03:55 Embracing Immutability with Arrays
    05:52 Mutable Nature of JavaScript Objects
    07:28 Immutability with Objects
    08:15 Why Is Immutability Important?
    09:00 Wrap up
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    😊About Me
    Hey! I'm Deborah Kurata
    I'm a software developer and UA-cam content creator. I speak at conferences such as VS Live and ng-conf. I write articles for freeCodeCamp. And I'm a Pluralsight author with courses in the top 10 most popular (out of 7,000+) over the past 5 years. For my work in support of software developers, I've been recognized with the Microsoft Most Valuable Professional (MVP) award, and I'm a Google Developer Expert (GDE).
    Contact me on Twitter (X): / deborahkurata
    Find my Pluralsight courses: www.pluralsight.com/profile/a...
    Access my freeCodeCamp articles: www.freecodecamp.org/news/aut...
    View my UA-cam content: / @deborah_kurata
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    #javascript #immutability #mutability #immutabilityinJavaScript
  • Наука та технологія

КОМЕНТАРІ • 35

  • @MarcoPinheiro
    @MarcoPinheiro 5 місяців тому

    Bravo!!

  • @abdulrenishr
    @abdulrenishr День тому

    Awesome explanation

  • @FuyadFuyad-ns6qg
    @FuyadFuyad-ns6qg 17 днів тому

    very informative and well descriptive tutorial video. Hope you will give us more and more informative and well descriptive tutorials .❤

  • @codingSparrow143
    @codingSparrow143 Місяць тому

    Thank you so much!! Very clear explanation❤❤

  • @jawwadalam
    @jawwadalam 5 місяців тому +1

    Detailed simple explanation of why immutability is important. Thank you 👍

    • @deborah_kurata
      @deborah_kurata  5 місяців тому +1

      So nice of you to say. Thank you for watching!

  • @ashutoshtiwari5222
    @ashutoshtiwari5222 5 місяців тому +1

    Simple yet informative.

  • @farzadbahadorifar1126
    @farzadbahadorifar1126 4 місяці тому

    you explain really well, thank for that.

  • @elyoaprogrammer
    @elyoaprogrammer 5 місяців тому +1

    So important topic explained by @DeborahKurata!!!

  • @RsPippen
    @RsPippen 5 місяців тому

    perfect timing! i was just dealing with a bug related to this topic

  • @Sinan997
    @Sinan997 5 місяців тому

    Great video again, now i know why immutability is important. Thank you!

  • @ngotienthien7939
    @ngotienthien7939 5 місяців тому

    thank a lot, That's so useful

  • @hodasalah1663
    @hodasalah1663 5 місяців тому

    you are the best Thanks a lot

  • @rs4267
    @rs4267 5 місяців тому

    As usual great job ❤

  • @JJOhns-fy4tl
    @JJOhns-fy4tl 3 місяці тому

    so glad i found your channel. thank you for your clear explanations. one question though: when creating a new object by using the spread operator and the original object contains an array, i would copy the reference of the array, wouldn't I? So maybe I should figure out a combination of using the spread operator to treat the object as immutable and the with() method for the array. Or am i on the total wrong track?

  • @karlee8608
    @karlee8608 5 місяців тому

    The video is very informative. You should include a visual evidence of the primitive data type being immutable. Same thing with object and array. I like how you make the connection to the memory instead of the value itself. It helps explain what is going on behind the hood in JavaScript. If you can show an updated video with actual example that would be grateful.

    • @deborah_kurata
      @deborah_kurata  5 місяців тому

      Thank you!
      In the description of the video, I have a link to some code that demonstrates immutability. It defines a variable of each data type (primitive, array, object) as a property of another object. It then demonstrates when the setter is called (code sees the value as changed) and when it isn't. Please see the video description for the link.

  • @respostasimples
    @respostasimples 5 місяців тому +1

    doing god's work Kurata, thanks!

  • @ibmmsayskhiedr4220
    @ibmmsayskhiedr4220 5 місяців тому

    Thanks a million I think immutability now became a piece of cake Thanks @Deborah

  • @abnow1998
    @abnow1998 5 місяців тому

    Hi Deborah, been following you since 2020, have watched all of your Angular courses on Plural sight, my request and I believe this is currently the hot topic: Next.js, pls make a series on this..