Explain passed by value and passed by reference.
String, and others.
Structural types (non-primitive) are
Function. Needed to mention that arrays and other structures have an
Object type too.
This means when you pass some value to the function its behavior will depend on its type.
In real-life apps, you need to be extra careful when changing any of provided function params, because debugging issues like this can be super tricky and time-consuming.
This is how you can fix this issue:
Other things to read:
Also, I will post more fun stuff here and on Twitter let's be friends 👋