Create a Stack Class: Tests Always Fail

Tell us what’s happening:
None of the tests work on this lesson unless you add “let” before collection, which is above the “Only change code below this line” line. Break this one little rule, and you should be good to go.

Your code so far


function Stack() { 
    collection = [];
    this.print = function() {
        console.log(collection);
    };
    // Only change code below this line

    // Only change code above this line
}

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/coding-interview-prep/data-structures/create-a-stack-class/

1 Like

Good catch. If this hasn’t been reported yet you should be the hero and open up a issue on the GitHub

https://forum.freecodecamp.org/t/how-to-report-a-bug/19543

Thanks that was helpful. I reported this issue in the FCC github.