Created
October 16, 2022 15:39
-
-
Save AdrianSkar/78edf950b5cb12e7549993f189075389 to your computer and use it in GitHub Desktop.
reversed and sortered Array of names
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const people = [ | |
'Bernhard, Sandra', | |
'Bethea, Erin', | |
'Becker, Carl', | |
'Bentsen, Lloyd', | |
'Beckett, Samuel', | |
'Blake, William', | |
'Berger, Ric', | |
'Beddoes, Mick', | |
'Beethoven, Ludwig', | |
'Belloc, Hilaire', | |
'Begin, Menachem', | |
'Bellow, Saul', | |
'Benchley, Robert', | |
'Blair, Robert', | |
'Benenson, Peter', | |
'Benjamin, Walter', | |
'Berlin, Irving', | |
'Benn, Tony', | |
'Benson, Leana', | |
'Bent, Silas', | |
'Berle, Milton', | |
'Berry, Halle', | |
'Biko, Steve', | |
'Beck, Glenn', | |
'Bergman, Ingmar', | |
'Black, Elk', | |
'Berio, Luciano', | |
'Berne, Eric', | |
'Berra, Yogi', | |
'Berry, Wendell', | |
'Bevan, Aneurin', | |
'Ben-Gurion, David', | |
'Bevel, Ken', | |
'Biden, Joseph', | |
'Bennington, Chester', | |
'Bierce, Ambrose', | |
'Billings, Josh', | |
'Birrell, Augustine', | |
'Blair, Tony', | |
'Beecher, Henry', | |
'Biondo, Frank', | |
]; | |
let orderedPpl = people.sort().map(val =>{ | |
return val.split(', ').reverse().join(', '); | |
}); | |
console.log(orderedPpl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment