I'd like to know if it is posible, having one or more variables to pass them into a function and get those variables modified. I think it is posible with objects, as they behave as references, but I don't know.
With 1 var you could do:
var something = increase(something);
but what if you have, for example, 2 variables with recipies, and would like to exchange them?
exchange_recipies(book1, book2);
You could do this but the variables are parameters inside the function... So is there another way that I'm missing?
EDIT: I know it can be done in many ways but I'll state some here that I don't like due to obvious limitations:
-Use global variables.
-Use objects
-Return an array and reasign.
EDIT2: this Is it possible to change the value of the function parameter? helped me, but I think that answer is uncomplet and there are ways of doing this.