Basic JavaScript - Use the Conditional (Ternary) Operator

Tell us what’s happening:
Describe your issue in detail here.

It just keeps on logging out Equal
Your code so far

function checkEqual(a, b) {
return a = b ? "Equal" : "Not Equal";
}

console.log(checkEqual(1, 1));

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 8.1.0; vivo 1908) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36

Challenge: Basic JavaScript - Use the Conditional (Ternary) Operator

Link to the challenge:

= is an assignment operator (its not a comparison operator).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.