items = [1, 5, 4, 3];
      const sortedArr = items.sort((a, b) => {
          return b - a;
      });

      Javascript language logo
      Sort array desc

      My JavaScript recipes

      Sort array in descending values

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.