Understanding Immutability in JavaScript

preview_player
Показать описание
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*

*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 YouTube 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).

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#javascript #immutability #mutability #immutabilityinJavaScript
Рекомендации по теме
Комментарии
Автор

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

jawwadalam
Автор

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.

karlee
Автор

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

RsPippen
Автор

So important topic explained by @DeborahKurata!!!

elyoaprogrammer
Автор

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

Sinan
Автор

Nice, this was a really good explanation why immutability is important, thank you :)

AesSedai
Автор

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

FuyadFuyad-nsqg
Автор

Thanks for your help, there's is a same concept of mutability and immutability in python also

MANAHILEJAZ-sz
Автор

Thank you so much!! Very clear explanation❤❤

house_sparrow
Автор

you explain really well, thank for that.

farzadbahadorifar
Автор

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?

JJOhns-fytl
Автор

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

ibmmsayskhiedr
Автор

slice performs a shallow copy of the array and it can be modified in future, so i think it should come under the mutable column

NawalFatima-em
Автор

doing god's work Kurata, thanks!

respostasimples
Автор

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

mechanical_engineer_
Автор

Hi Deborah, in the video you give an example of primitives being immutable.
So the code

total = 42; // (1)
total += 10; // (2)

means that in (1), total is pointing at a memory with value 42. Then, in (2), total is pointing at a different memory address with value 52.

But how can we re-access the value 42 ?? (We don't know the memory address for this anymore ?)

GreenClearScenery
Автор

one question : i've read that dynamic arrays (which we use in javascript) create a new array in memory in case of adding new value which would exceed the length of the array, so does that mean that sometimes the address of the array change ?

SolidWorksMastery-hrsg
Автор

How to get value of p variable by prev address x?

povdata
welcome to shbcf.ru