Skip to content

"Where do I belong", issue while sorting the array #7606

Closed
kikreddy opened this Issue · 1 comment

2 participants

@kikreddy

function where(arr, num) {
// Find my place in this sorted array.
var newArr = [];
newArr=arr.sort();

return newArr;
}

where([1, 3, 20, 3], 5);

o/p : [1,20,3,3]

instead it should give output as [1,3,3,20]

in place of 20, numbers from 10 to 29 can be placed which gives the same issue... pls fix that issue

@ltegman
Free Code Camp member

Github issues are not for challenge help. Please visit the Help Chat for assistance. Thanks and happy coding!

@ltegman ltegman closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.