Perils of Mutability
Learn why the immutability concept was introduced in JavaScript.
We'll cover the following...
let
does not permit the redefinition of variables, but it allows changing the value held in the variable.
Mutable data example in JavaScript
Without executing it, look at the following code to determine what the output will be.
Press + to interact
'use strict';let factor = 2;let product = function(number) {return number * factor;};factor = 0;console.log(product(4));
Show the code to your ...
Access this course and 1400+ top-rated courses and projects.