Created
November 13, 2020 02:12
-
-
Save GAierken/851844056ae45cbb1d3da04732f72fac to your computer and use it in GitHub Desktop.
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 sortedSquares = (A) => { | |
return A.map((ele) => { // transform the given array | |
return ele*ele //square the element | |
}).sort((a,b) => { | |
return a-b // sort by ascending order | |
}) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment