+ 1

Stuck at 9.2 Data Comparison Class - multiple

This is what I type in: function main() { var oldPass = readLine(); var newPass = readLine(); var oldPass = "hl8792m"; var newPass = "hl8792m"; console.log(oldPass==newPass); } function main1() { var oldPass1 = readLine(); var newPass1 = readLine(); var oldPass1 = "nav19314lu"; var newPass1 = "naV19314lu"; console.log(oldPass1==newPass1); } function main2() { var oldPass2 = readLine(); var newPass2 = readLine(); var oldPass2 = "Dave19981"; var newPass2 = "Dave19981"; console.log(oldPass2==newPass2); } but I still get the message that 1 out of 3 Test Cases is wrong. In Test Case 2 the output should be false. And for me it should output false.

15th Aug 2021, 12:13 PM
xadrus1799
xadrus1799 - avatar
5 odpowiedzi
+ 2
// The whole code will only be: function main() { var oldPass = readLine(); var newPass = readLine(); console.log(oldPass==newPass); } // Next time please save your code on SL Playground and link here
15th Aug 2021, 2:30 PM
JaScript
JaScript - avatar
+ 2
You get already the input data and need only to writte console.log(oldPass === newPass);
15th Aug 2021, 12:26 PM
JaScript
JaScript - avatar
+ 2
There will be run a code on SL server.
15th Aug 2021, 2:35 PM
JaScript
JaScript - avatar
+ 1
If I change it to this: function main() { var oldPass = readLine(); var newPass = readLine(); var oldPass = "hl8792m"; var newPass = "hl8792m"; console.log(oldPass==newPass); } function main1() { var oldPass1 = readLine(); var newPass1 = readLine(); var oldPass1 = "nav19314lu"; var newPass1 = "naV19314lu"; console.log(oldPass1===newPass1); } function main2() { var oldPass2 = readLine(); var newPass2 = readLine(); var oldPass2 = "Dave19981"; var newPass2 = "Dave19981"; console.log(oldPass2===newPass2); } or this: function main() { var oldPass = readLine(); var newPass = readLine(); var oldPass = "hl8792m"; var newPass = "hl8792m"; console.log(oldPass===newPass); } function main1() { var oldPass1 = readLine(); var newPass1 = readLine(); var oldPass1 = "nav19314lu"; var newPass1 = "naV19314lu"; console.log(oldPass1===newPass1); } function main2() { var oldPass2 = readLine(); var newPass2 = readLine(); var oldPass2 = "Dave19981"; var newPass2 = "Dave19981"; console.log(oldPass2===newPass2); } the result of the cases stay the same!
15th Aug 2021, 2:11 PM
xadrus1799
xadrus1799 - avatar
+ 1
but how does the function tests for the passwords that are shown in the Test Cases? Thanks!
15th Aug 2021, 2:32 PM
xadrus1799
xadrus1799 - avatar