Chunky Monkey: I'm returning the given solution but not solving the problem
See original GitHub issueChunky Monkey
https://www.freecodecamp.com/challenges/chunky-monkey
Issue Description
The code I’ve written correctly follows the steps as described in the problem and I’m returning the correct solution to each instance. However, none of the instances are being checked off as correct.
Browser Information
- Browser Name, Version: Chrome
- Operating System: Windows 7
- Mobile, Desktop, or Tablet: Desktop
Your Code
var segments = [];
var newArray = [];
function chunkArrayInGroups(arr, size) {
// Break it up.
for (var i = 0; i < arr.length; i += size) {
segments = arr.slice(i, i+size);
newArray.push(segments);
console.log(newArray);
}
return newArray;
}
chunkArrayInGroups(["a", "b", "c", "d"], 2);
Screenshot
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Chunky Monkey: I'm returning the given solution but not ...
The code I've written correctly follows the steps as described in the problem and I'm returning the correct solution to each instance. However, ......
Read more >Chunky Monkey isn't working - JavaScript
Hi, I'm not sure what to do. I'm here expecting that the for loop increases by size and slices in this case with...
Read more >Chunky Monkey - by Hugh Winchester
We need to write a function that splits an array (first argument) into groups the length of size (second argument) and returns them...
Read more >free code camp -> Bonfire: Chunky Monkey
Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional...
Read more >Holding 2 | Literature Quiz
Play this game to review Literature. What sentence states the main idea of a paragraph?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yeah that would make it more clear. I still have trouble with it at times because sometimes it is necessary to create it globally because if I create a local variable and try to call it outside I get the “out of scope” error. So yeah some clarification on that would go a long way. Thanks for your help!
Please use the Help chat room for getting challenge related help. Happy Coding!