Code is not working on this JavaScript Project
return a == b ? true : false;
I tried many variations
return a === b ? true : false;
return a === b ? false: false;
return a > b ? true: false; … etc
Nothing is working!
Code is not working on this JavaScript Project
return a == b ? true : false;
I tried many variations
return a === b ? true : false;
return a === b ? false: false;
return a > b ? true: false; … etc
Nothing is working!
Provide more context, where are using it?
function checkEqual(a, b) {
return a == b ? true : false;
}
console.log(checkEqual(1, 2));
I just copy pasted your code and it worked
I wonder why my editor keep rejecting it? I’m using Mozilla firefox maybe that’s the issue?
I keep getting
// running tests
checkEqual(1, 2)
should return “Not Equal”
checkEqual(1, 1)
should return “Equal”
checkEqual(1, -1)
should return “Not Equal” // tests completed
I’m using firefox too
Yes now, you’re not returning the right values
try return a == b ? "Equal" : "Not Equal"
Thanks Bro! I actually tried that but I left out the Quotes!
No problem, but I think the quotes should be there because this is a string.
True! Now I can finish this JavaScript section! onWard to victory!