27/33 Where is this coming from?


#1



https://www.codecademy.com/courses/spencer-sandbox/4/2?curriculum_id=506324b3a7dffd00020bf661


This code works fine but it leaves me curious...

// Our Person constructor
function Person (name, age) {
this.name = name;
this.age = age;
};

// Now we can make an array of people
var family = new Array();
family[0] = new Person("alice", 40);
family[1] = new Person("bob", 42);
family[2] = new Person("michelle", 8);
family[3] = new Person("timmy", 6);

// loop through our new array
for (var i = 0; i < family.length; i++) {
    console.log(family[i].name);
}; 

I get this for the answer:

"alice
bob
michelle
timmy
---
We're running a test below to make sure your code works.
alicebobmichelletimmy"

I just don't understand where that second paragraph comes from in the code. Can someone explain that?


#2

Your code is correct :slight_smile: It's just a quirk in the lesson, sometimes there are glitches and bugs. Read more here: https://discuss.codecademy.com/t/were-running-a-test-below-to-make-sure-your-code-works-what-test/37370/2


#3

I'm not sure, but I am going to make a guess and say that it was probably the computer. The people from codecademy might have it set up so that the computer does that every once in a while, or it might just be the computer making sure that the all the code in that exercise was right. That's my guess.


#4