We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

mc0re • 1 year ago

Array.reverse()
"the original array will not be affected" - this is not what the code shows. Type in:
var arr = [true, 2, 3, "4"];
new_array = arr.reverse()
console.log(new_array); // ["4", 3, 2, true]
console.log(arr); // ["4", 3, 2, true]

"arr" and "new_array" yield the same.

The same goes for Array.sort()

RunninglVlan • 1 year ago