Completed basic Javascript Section but stil not full confident on recursion and some other stuffs

What should I do in this case? Should I spend some more time practicing recursions and other things I don’t have a solid grip on before moving on to the ES6 section. I heard it was much harder than the first basic section. Basic section was easy for me till I reached about 80% or so. The record collection, profile lookup etc was not that easy. And the recursion sections’ challenges were very hard. The second last one at 98% was the hardest. Had to spend so much time trying to understand it was so relieved when I finally understood.

In the very last challenge we were told to create a range of numbers, I wrote the code and to my surprise passed the test(I had a very vague idea of what I was doing just was trying to make it like the previous challenge’s code)
Here’s my code. I was surprised that it passed the test then I spend next 20 minutes trying to figure out why it worked(still I can’t figure it out by just looking at it, have to spend some time with paper and a pen to sketch out the solution using lines and boxes and thus I am wondering whether I am ready to handle ES6 section or whether I should spend more time in the basic section.

function rangeOfNumbers(startNum, endNum) {
  if(startNum==endNum){
    return [startNum];
  }
  else{
        var array=[startNum];
        var array=rangeOfNumbers(startNum,endNum-1);
        array.push(endNum);
        return array;
  }
};

Honestly, pen and paper are one of my favorite learning tools :smiley:

I wouldn’t worry too much if you don’t understand some stuff on 100%, it takes time and practice to fully understand certain things.

Please, don’t get me wrong, I’m not saying to rush through the lectures just for the sake of checking off the challenges but from what you’ve said it looks to me that you took your time to try understand as much as you can so it’s great :smiley:

I think you should go on, it’s not a one way ticket and you can always revisit old lectures if you feel like going to fast :wink:

PS I find ES6 features way easier than recursion :wink:

That

1 Like

Thanks for your reply. I just began ES6 and yes it looks alright so far(25% completed)

I think the algorithm scripting will be hard. Was planning to go through the entire curriculum but finding the very first section hard kind of demotivated me in the beginning. Hopefully the algorithm and all sections will be doable too.