-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Waypoint: Iterate over Arrays with map accepts incorrect code after initial pass #5428
Comments
👍 |
Confirmed. I was able to do this on Chrome. Maybe the tests are stateful in some way? |
This issue isn't unique to this way point. the next waypoint var array = [4,5,6,7,8];
// Only change code below this line.
var singleVal = array.reduce(function(a,b){
return a + b;
});
// Only change code above this line.
(function() {return singleVal;})(); Then if you try this right after test passes, the reported unexpected behavior of tests passing happens here: var array = [4,5,6,7,8];
// Only change code below this line.
//var singleVal = array.reduce(function(a,b){
// return a + b;
//});
// Only change code above this line.
(function() {return singleVal;})() But if you try this right after tests pass, tests still fail appropriately: var array = [4,5,6,7,8];
// Only change code below this line.
var singleVal = array.reduce(function(a,b){
return a - b;
});
// Only change code above this line.
(function() {return singleVal;})() Tests also fail appropriately in the waypoint that this was reported when submitting invalid code. It appears only to be when there is no code or disabled code that produces this issue. |
If we declare the newArray variable in the seed code then upon removal of the code to pass the test we will get a failing test once again.
The second test still passes since |
@natac13 Absolutely. We're open to PRs to more effectively test this. While you're at it, you can move the display function to the tail. You may need to add a "tail" to do so. |
@SaintPeter not exactly sure what you mean by move the display function to the tail... |
Understand now Thanks! |
what is the need of this >> "(function() {return newArray;})();" we also can do like this |
Is in the example for this section but in the example it has a * sign and is + for your assignment. It says it in the requirement "add three to each value" the key word is ADD. |
ADD is + so when you write: |
Challenge Waypoint: Iterate over Arrays with map has an issue.
User Agent is:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
.Please describe how to reproduce this issue, and include links to screenshots if possible.
After you pass the test once you can submit "incorrect" code and still pass.
Seems like a minor issue but it would affect people copying and pasting code from chat when assisting others if they have already finished this waypoint.
After some more testing though, hitting the reset button does seem to fix this but I personally usually just paste over all my old code instead of hitting reset.
My code:
First pass:
Second pass:
On this user-agent I believe it checks for the existence and valid use of
.map()
while on,Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
it seems to also check for the correct array and values which can be hard-coded after initial pass.
The text was updated successfully, but these errors were encountered: