Skip to content

Commit 737f43b

Browse files
author
Vamsi Krishna
committed
Added code to sort array
1 parent 5614404 commit 737f43b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎SortingAlgorithms/sortArray.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function sortArray (arr){
2+
arr.sort((a, b) => a- b);
3+
return arr;
4+
}
5+
6+
let arr = [3,1,2,4]
7+
console.log(sortArray(arr));

0 commit comments

Comments
 (0)