129
rated 0 times
[
132]
[
3]
/ answers: 1 / hits: 44424
/ 8 Years ago, tue, july 12, 2016, 12:00:00
I am new to JavaScript, and I have an array which contains numbers.
var arr = [2,4,8,1,5,9,3,7,6];
How can I sort it using a native for loop in JavaScript?
I know sort function is available, but I want it through for loop.
The output should be:
var res = [1,2,3,4,5,6,7,8,9];
More From » arrays