question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in 'Waypoint: Iterate Odd Numbers With a For Loop'

See original GitHub issue

The code that appears when this waypoint loads is the answer to the challenge.

Let’s change our initialization and final-expression so we can count by odd numbers. Push the odd numbers from 1 through 9 to myArray using a for loop.

var ourArray = [];
for(var i = 1; i < 10; i += 2){
  ourArray.push(i);
}
var myArray = [];
// Only change code below this line.

// Only change code above this line.
if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ltegmancommented, Oct 29, 2015

I think the point of this bug is that the rest of the waypoints don’t generally have the example code using ourArray be the exact same code you need to do with myArray. There’s usually some subtle difference between the two. In the one you could just copy and paste it and change our to my.

0reactions
henrihyacinthecommented, Mar 30, 2017

removed solution by mod

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in 'Waypoint: Iterate Odd Numbers With a For Loop' #3966
The code that appears when this waypoint loads is the answer to the challenge. Let's change our initialization and final-expression so we can ......
Read more >
Basic JavaScript Lesson: Iterate Odd Numbers With a For Loop
Certification: JavaScript Algorithms and Data StructuresCourse: Basic JavaScriptLesson: Iterate Odd Numbers With a For LoopfreeCodeCamp ...
Read more >
What is wrong with my for loop? All odd numbers are not ...
The problem here is that you are removing elements while you are looping over the list. So, when you remove the item at...
Read more >
range - Functions - Configuration Language | Terraform
range Function. range generates a list of numbers using a start value, a limit value, and a step value.
Read more >
3xu5tycqp - Java - OneCompiler
Main.java:2: error: class, interface, or enum expected (function(t) ... is even number"); } else { System.out.println("i is odd number"); } ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found