Isn't these two programs(portion of number valudation in JS) have same output? 1 is working but 2 is not, please help me out | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Isn't these two programs(portion of number valudation in JS) have same output? 1 is working but 2 is not, please help me out

Here are two codes: 1. if((b.charAt(1)==8) ||(b.charAt(1)==7)) { true; } else { document.getElementById('number1').innerHTML="**Number should start from 98 or 97" return false; } 2. if((b.charAt(1)!=8) ||(b.charAt(1)!=7)) { document.getElementById('number1').innerHTML="**Number should start from 98 or 97" return false; } https://code.sololearn.com/W1QCNwuF6jlp/?ref=app

2nd Apr 2022, 2:56 PM
Logician S
Logician S - avatar
0 Answers