DEV Community

loading...

Discussion on: Understanding concepts of functional programming with JavaScript

Collapse
mbackermann profile image
Maurício 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
helderburato profile image
Helder Burato Berto Author

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

Collapse
mbackermann profile image
Maurício Ackermann

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