In the following code i m always getting 1 as a answer...!!! How to fix it?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

In the following code i m always getting 1 as a answer...!!! How to fix it??

Want to make an Periodic table i used the concept of if and else if as i used it in my Calculator but its not working here.... https://code.sololearn.com/WhCoHyNFeNQq/?ref=app

12th Dec 2017, 7:59 PM
A N S H U L S I N G H
A N S H U L   S I N G H - avatar
2 Answers
+ 7
Working....thnx bro....
12th Dec 2017, 8:36 PM
A N S H U L S I N G H
A N S H U L   S I N G H - avatar
+ 1
Your conditional operator should look like this: if (yo=="something1"||yo=="something2"){ alert("something3"); } || - is or operator in js
12th Dec 2017, 8:33 PM
MuzzRK
MuzzRK - avatar