diff --git a/specs/insertion-sort/insertion-sort.solution.test.js b/specs/insertion-sort/insertion-sort.solution.test.js index 708f8f75..c66c5af1 100644 --- a/specs/insertion-sort/insertion-sort.solution.test.js +++ b/specs/insertion-sort/insertion-sort.solution.test.js @@ -14,7 +14,7 @@ function insertionSort(nums) { let j; // the inner counter // loop from the right to the left - for (j = i - 1; nums[j] > numberToInsert && j >= 0; j--) { + for (j = i - 1; nums[j] > numberToInsert; j--) { // move numbers to the right until we find where to insert nums[j + 1] = nums[j]; }