Tests can't be validated

Tell us what’s happening:
I can’t figure out what’s the error could be. Please see error section below.
Your help is greatly appreciated.
Thank you

// running tests
joinDogFraternity should use the constructor property.
// tests completed
// console output

Your code so far

function Dog(name) {
 this.name = name;

// Add your code below this line
function joinDogFraternity(candidate) {
 return candidate.constructor === Dog
let dog = new Dog('mydog')
console.log(dog.constructor === Dog)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4039.0 Safari/537.36.

Challenge: Understand the Constructor Property

Link to the challenge:

Read the requirements again.

Write a joinDogFraternity function that takes a candidate parameter and, using the constructor property, return true if the candidate is a Dog, otherwise return false.

Have a look at the code example given as well for another hint.

After restarting my machine, the same code passed the test. Strange!