is javascript pass by reference?
In JavaScript, all function arguments are always passed by value. It means that JavaScript copies values of the variables that you pass to a function into local variables. ... If function arguments are passed by reference, the changes of variables that you pass to the function will be reflected outside the function.