• sort()

    • Sorts the elements of an array in place.

    • Example:

      let fruits = ['Banana', 'Apple', 'Mango'];
      fruits.sort();
      console.log(fruits); // Output: ['Apple', 'Banana', 'Mango']
      
      
  • reverse()

    • Reverses the order of the elements in an array.

    • Example:

      let fruits = ['Apple', 'Banana', 'Mango'];
      fruits.reverse();
      console.log(fruits); // Output: ['Mango', 'Banana', 'Apple']