SyntaxFix
Write A Post
Hire A Developer
Questions
I adapted @shareef's answer to make it concise. I use,
.sort(function(arg1, arg2) { return arg1.length - arg2.length })