Challenge increment-a-number-with-javascript has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.
var myVar = 88;
// Only change code below this line
myVar = myVar++;
myVar++ is the same as writing myVar = myVar + 1. So just writing myVar++ will set myVar to 89, while myVar = myVar will set it to undefined.
Instructions say
The entire line becomes
i++;, eliminating the need for the equal sign.
@khamp19 there are two things incorrect in your code. The one that others have mentioned, but also, you've manually changed the value of myVar to 88.
There is another bug for this challenge. I use the correct code and I can't get it to pass with
var myVar = 87;
// Only change code below this line
myVar++;
And I had an issue with the second test
myVar = myVar + 1;should be changed
The challenge test can be found on this line and essentially has this regex test
/myVar\s*\=.*myVar\s*\+\s*1/.test(code) === false
I'm on Chrome Version 58.0.3029.81 (64-bit). I'll leave this open for others in case it can be reproduced.
I'm also getting the same error
Same here
On Apr 22, 2017 5:42 AM, "Alistair Laing" notifications@github.com wrote:
I'm also getting the same error
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/freeCodeCamp/freeCodeCamp/issues/14510#issuecomment-296364704,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AaZSden4OQkmVQoCLesz2xzJwQXwQE33ks5rydmqgaJpZM4NDSNV
.
this is my code,and i have passed this course,just like this :
removed solution by mod
@erictleung worked ere on Google Chrome 58.0.3029.96 (64-bit) and Opera 44.0.2510.1218 (64-bit)
Is this bug resolved? or can I fix it?
This challenge does not have any bug, solution of @erictleung pass the challenge.
@charlesBak thanks for checking up on this. I am now unable to reproduce the error I've posted above. If someone else can verify this is the case, I will go ahead and close this issue as resolved.
cc/ @freeCodeCamp/moderators
hi @erictleung i am also unable to reproduce the error, tested on Chrome and firefox.
this is the post increment so this incremented after assign for pre-increment use ++myVar
@khamp19 @aliuk2012
apply this so that you can proceed to the next page:
Content Hidden - by mod
I am also having this problem. It will not verify that the line is changed for the second test.
var myVar = 87;
// Only change code below this line
myVar++;
var myVar;
This works fine give a try
Most helpful comment
@khamp19 there are two things incorrect in your code. The one that others have mentioned, but also, you've manually changed the value of
myVarto 88.There is another bug for this challenge. I use the correct code and I can't get it to pass with
And I had an issue with the second test
The challenge test can be found on this line and essentially has this regex test
I'm on Chrome Version 58.0.3029.81 (64-bit). I'll leave this open for others in case it can be reproduced.