Skip to content
Advertisement

How do I update a variable inputted to a function?

I am trying to make a function in my js file that will remove an item from an array and then save the new array to the variable. But here’s the thing: I don’t want it to only save ONE variable, I want it to save any array variable that I input. What I mean is something like this:

JavaScript

Advertisement

Answer

You can create a prototype function, see this

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement