Tell us what’s happening:
Describe your issue in detail here.
This is more a suggestion than a question while trying to solve challenges, I want to be able to test my solutions step by step. But the platform just take a complet working answer of the challenge. I’m wondering if it is pedagogical to see result of my code small iteration before solving the whole problem asked ? Your code so far
function sumAll(arr) {
let sum = 0;
for (let i = 0 ; i <= arr.length-1 ; i++){
return sum += arr[i];
}
}
sumAll([1, 4]);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36
By this time you should have completed the Debugging section of the JS curriculum, where various practices to check and test your code(even by segments) are present and explained. The challenges themselves, often output test of several parameters before the final solution is being accepted. The challenges themselves can actually be looked as smaller problems which can eventually be present in a large application, a project, which can consist of tens and thousands of for loops, functions and data segments, so its really important you learn to write your code(and test it) without being monitored on every step. You should also be aware, very often, more than one solution is available for a challenge and the test suite cant track and correct each one of them; its often meant to encourage varous solutions and freedom for the learner.
There is this as well, which shows your code finning step by step. Only really useful for single functions (there is a hard limit on the amount of steps, so anything bigger and it’s generally going to refuse to run it), but it’s very useful for (eg) the algorithm challenges:
You are right about the debugging completed part I noticed it with the answer of @ilenia. I realized that one of it’s utility comes in here as answer to my question.
Thank you for your highlights about my question, I have a larger view of the course now.