Challenge Answers Explained | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

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?

4th Apr 2018, 1:58 PM
Levi
Levi - avatar
10 Answers
+ 24
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)
4th Apr 2018, 3:20 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 22
//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]
4th Apr 2018, 4:07 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
4th Apr 2018, 2:28 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 21
welcome & thanks 4 kind words ☺👍Levi
4th Apr 2018, 4:12 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
There is nothing stopping you from posting the question here. Here is an example of where I did exactly that. https://www.sololearn.com/Discuss/1017883/?ref=app
4th Apr 2018, 2:19 PM
Louis
Louis - avatar
+ 2
Thanks Louis and Gautama. I am going to take you up on both of your suggestions.
4th Apr 2018, 3:09 PM
Levi
Levi - avatar
+ 2
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.
4th Apr 2018, 3:18 PM
Levi
Levi - avatar
+ 1
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?
4th Apr 2018, 3:41 PM
Levi
Levi - avatar
+ 1
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.
4th Apr 2018, 4:12 PM
Levi
Levi - avatar
+ 1
Thank you!!!
4th Apr 2018, 4:14 PM
Levi
Levi - avatar