Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bonfire: Chunky Monkey code is not being executed #3911

Closed
JonathanKumar95 opened this issue Oct 26, 2015 · 3 comments
Closed

Bonfire: Chunky Monkey code is not being executed #3911

JonathanKumar95 opened this issue Oct 26, 2015 · 3 comments

Comments

@JonathanKumar95
Copy link

Challenge Bonfire: Chunky Monkey has an issue.
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

Okay so i was working on this test for a while and all of a sudden it got stuck and stopped executing code.

My code:

function chunk(arr, size) {
  // Break it up.
  var returnArr = [""],
      tempArr   = [""];
  for(var i=0;i < size; i = i++){
    returnArr[i] = arr[i];
  }
  return arr;
}

chunk(["a", "b", "c", "d"], 2);

...
@BerkeleyTrue
Copy link
Contributor

Hello @JonathanKumar95

The third field in you for loop should not re-assign the variable you are tracking. Try:

// for loop signature ( variable to track, conditional to validate against, expression that should increment variable)
for(var i=0; i < size;  i++){

@JonathanKumar95
Copy link
Author

Oh gosh, i didn't identify that before, the entire program got stuck so i thought it was a fault with the test. Thanks a lot btw.

@BerkeleyTrue
Copy link
Contributor

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants