Skip to content

Commit 4089ff6

Browse files
authored
Merge pull request vJechsmayr#87 from VamsiKrishna04/add-arr-sort-algo
Added code to sort array
2 parents 27ee1c9 + 737f43b commit 4089ff6

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)