I am looking to find out what type of function it is in JavaScript that modifies the original variable, as shown below.
let array = ["a", "b", "c"]
console.log(array) // Returns: ["a", "b", "c"]
array.shift()
console.log(array) // Returns: ["b", "c"]
With other functions, you would normally have to do the following.
let string = " String "
console.log(string) // Returns: " String "
string.trim()
console.log(string) // Returns: " String "
string = string.trim()
console.log(string) // Returns: "String"
How would I reproduce the same type of function?