Question from the Javascript test

Write a function in Javascript that checks if an object has a property with a specific value.

Hard

What is the output ?

function ageOfW3D(data) {
  if (data === { age: 5 }) {
    console.log("WeLoveDevs a 5 ans");
  } else if (data == { age: 5 }) {
    console.log("WeLoveDevs a peut être 5 ans.");
  } else {
    console.log(`WeLoveDevs est fantastique.`);
  }
}

ageOfW3D({ age: 5 });
Author: Vincent CotroStatus: PublishedQuestion passed 229 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!