Created
July 24, 2021 20:03
-
-
Save alibalbars/e33608890ffb567d7e15e5bc11049912 to your computer and use it in GitHub Desktop.
sort with slice
This file contains hidden or 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
let array = ['bingöl', 'ordu', 'adana']; | |
let sortedArray = array.slice().sort(); | |
console.log(array); // (3) ["bingöl", "ordu", "adana"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment