0

Trying to create a function that would compare 2 items based on equality. Unfortunately, it doesn't work properly please help.


//This is what I have so far:
function checkEquality(a,b){
    if (a===b) {
        return "The type and values are equal."
   }else if (a==b && typeof a !== typeof b) {
    return "The type is different."
  }else if (a!==b){
    return "The value and type are different."
  } 
}
console.log(checkEquality(1,true))
console.log(checkEquality(0,"0"))
console.log(checkEquality(1,1))
Kat Shepil
  • 25
  • 3

0 Answers0