1 min readAug 13, 2019
Thanks, you are right. I wrote that output because I did the following:
let arraySort = [‘India’, ‘Germany’, ‘China’, ‘Japan’];
console.log(arraySort.sort()); //[“China”, “Germany”, “India”, “Japan”]
//Reverse function
console.log(arraySort.reverse()); //[“Japan”, “India”, “Germany”, “China”]
Notice the variable usage. This would give me result as [“Japan”, “India”, “Germany”, “China”] for reverse().