Reset account passwords should not be the same as the old password. Write a program that takes old and new passwords as inputs and outputs to the console the boolean value (true or false) that shows whether or not they match. Sample Input hl8792m hl8792m Sample Output true function main() { var oldPass = redline(); Var newPass = redline(); //Your code goes here }
2/13/2021 9:38:10 AM
NIKHIL SONAWANE23 Answers
New AnswerHi! You can show us your attempt? Put your code to code playground section and paste link here
You need to add below if statement to log true and false in console. If(oldPass===newPass) { console.log(true);} else { console.log(false);}
function main() { var oldPass = readLine(); var newPass = readLine(); // Your code goes here console.log(oldPass == newPass) } //think in an easy way . Hope that will work Perfectly Chill.
What's wrong with: function main() { var oldPass = "hl8792m"; var newPass = "hl8792m"; console.log(oldPass==newPass); }
Have to write program that takes old and new passwords as inputs and outputs to the console the boolean value and output should be true
= this is the assignment operator (variable value) == this is the comparison operator (in your case). be careful and compare values of the same type. js likes to implicitly convert values of different types when comparing
Am done I used all the operator but still not getting output please if you know the answer explain me
I told you how to do it: create a file in the encoding section { }. select the js programming language. insert or write all your code there. not a piece of code, but everything you need. save this file there. make it public. and send the link here in the conversation. it is very difficult to help in words
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message