Tell us what’s happening:
Looking at the debugger, looks like the loop exit too early due to a _LP variable that check for elapsed time. It’s very strange the loop protection is activated just to enumerate an array and print its values.
Your code so far
function bubbleSort(array) {
// change code below this line
const length = array.length;
console.log(length);
for(let i=0; i<length; i++)
console.log(i);
// change code above this line
return array;
}
// test array:
// [1, 4, 2, 8, 345, 123, 43, 32, 5643, 63, 123, 43, 2, 55, 1, 234, 92]
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.
Link to the challenge:
https://learn.freecodecamp.org/coding-interview-prep/algorithms/implement-bubble-sort/