Search⌘ K

Variable Mutation

Explore variable mutation in JavaScript by learning how to reassign values and copy variables. Understand how reassignment affects stored values and memory usage. This lesson helps you grasp a key concept in managing and manipulating data in your code.

We'll cover the following...

Mutation

Variable mutation is reassigning a variable to another value. This is simply done with the assignment operator =.

The above slides show how assigning a variable into another value will reassign it to a new value while losing the link to the previous value.

NOTE: When a variable is reassigned, it no longer holds its previous value. That previous value may ...