let a=10; let b=10; let c=10;
if(a==b==c)
console.log("Same");
}
else {
console.log("Not Same");
}
let a=10; let b=10; let c=10;
if(a==b==c)
console.log("Same");
}
else {
console.log("Not Same");
}
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh KumarPosted Apr 4, 2024, 9:54 AM
You are missing {} braces in if condition.
It will log as "Not Same"
Jithu ThomasPosted Apr 4, 2024, 6:39 AM
The correct form of usage. will give correct output.
Jayraj ChhayaPosted Apr 4, 2024, 6:03 AM
As above code answer is "Not same".
In the given code, the comparison
a==b==cmight not work as expected. JavaScript does not support chaining comparison operators like this.