Any one help?? | Sololearn: Learn to code for FREE!

+1

Any one help??

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 SONAWANE

23 Answers

New Answer

+3

Hi! You can show us your attempt? Put your code to code playground section and paste link here

+2

Huhuhu please

+2

Thank you ☺️ hehe but ,it's done

+1

You need to add below if statement to log true and false in console. If(oldPass===newPass) { console.log(true);} else { console.log(false);}

+1

Some one can help this to mr

+1

hi Analyn, what was the question, did you figure it out?

+1

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.

+1

What's wrong with: function main() { var oldPass = "hl8792m"; var newPass = "hl8792m"; console.log(oldPass==newPass); }

0

and what's your doubt here?

0

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

0

use a if condition...

0

Don't know how to use I tried

0

you should use the condition operator as suggested above

0

Output should be true so I have to use == or = if am wrong please correct me

0

= 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

0

Am done I used all the operator but still not getting output please if you know the answer explain me

0

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

0

https://www.sololearn.com/post/217555/?ref=app

0

Did it work?

0

congrats