Challenge Answers Explained | SoloLearn: Learn to code for FREE!


Challenge Answers Explained

I think it would be very helpful to see challenged explained or have the ability to comment and discuss the questions as we do in the learning quizzes. I know we can see the correct answers once the challenge is completed which is very helpful but I don’t always understand the answer and would love the feedback. Is there a way to get this that I am missing?

4/4/2018 1:58:47 PM


10 Answers

New Answer


8*3 +1 =24 +1 =25 //before 25 ... 22 will be there[21+1 ie 3*7+1] [in 7th cycle of loop] //condition true for 7th cycle ... but just after getting 25 [in end of 7th cycle ie beginning of 8th cycle], loop stops as condn becomes false [25 is !smaller than 24]. //btw My name is "Gaurav" , every time some1 do this 😅 //hope It makes sense,anydoubt will be answered later(time up)


//welcome & here is the more explanation ☺👍 //yeah , nice name to me [will try harder to deserve that respect] see carefully , there is a table of 3 going ... if initial value of var i be 0 ... 0 ,3,6,9,12,15,18,21,24,27 //if var i is 1 ... then +1 to each term .... 1,4,7,10,13,16,19,22,25,28 //so did U notice , no 26 comed in the series ... its 25 [not 26]


comment box suggestion


welcome & thanks 4 kind words ☺👍Levi


There is nothing stopping you from posting the question here. Here is an example of where I did exactly that.


Thanks Louis and Gautama. I am going to take you up on both of your suggestions.


Here is the question that I am struggling with. It is basic JS: What is the output of this code? for (var i = 1; i<24; i += 3) {} alert (i) The answer is 25, but I am not seeing why. I am sure it will hit me in the face once explained but can’t find the answer online.


Sorry Gaurav... spellcheck wants to change your name to the Buddha apparently. :) That said, I really appreciate you taking the time to respond, but still confused... where are you getting the 8? Wouldn’t the loop stop at 23 just before 24 and then simply add 3 to make 26?


I get it!! I didn’t realize the i += 3 meant incremento by threes I thought it meant add three. Totally get it... your the best and deserve the respect of both names.


Thank you!!!