DEV Community

Discussion on: Understanding concepts of functional programming with JavaScript

Collapse
 
mbackermann profile image
Mauricio Ackermann

From mutability example, the code is wrong. If you console.log(animals) it will always print 2, since it has never been changed

Collapse
 
helderberto profile image
Helder Burato Berto • Edited

Thanks for the reply! I updated the variable to mutatedAnimals should print the correct length.

Collapse
 
mbackermann profile image
Mauricio Ackermann

Np! Nice article btw! Thank you for your contribution.