When using the built-in methods available for arrays in Javascript, some methods will act directly on the calling array. For example, myArray.sort(), will sort myArray in ascending order, alphabetically or numerically.
myArray.sort();
// sort() acts directly on myArray, changing it in its place thereafter
// ... also myArray.reverse() amongst others.
While other methods such as slice(), require there be something, either a variable or other output for it to return its value to...
var need_a_new_array = myArray.slice(10, 21);
// a new placeholder is needed for the results of slice... if not using
// the results immediately (i.e. passing to another function or
// outputting the results)
I was wondering what is the proper terminology for these methods and their differences. I am using arrays as an example here, but I'm sure that the same probably holds true for objects in general. I appreciate any help. Thank you.