JSFiddle - React, Tailwind, and code Playground

JavaScript

words_Array = ["Why", "doesnt", "this", "work?"];

var sortedWords_Array = words_Array;

sortedWords_Array.sort(function(a, b){
    return b.length - a.length;
});

alert("sortedWords_Array is :"+sortedWords_Array);
alert("words_Array is :"+words_Array);