Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort an array by the laster letter of element javascript

function last(arr){
    return arr.sort((a, b) => a.charCodeAt(a.length - 1) - b.charCodeAt(b.length - 1));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #array #laster #letter #element #javascript
ADD COMMENT
Topic
Name
2+8 =