What is wrong with this?
 {
let password = 258921;
if (passwordimput === password) {
print('nice! you got it right!');
} else {
print('sorry, your wrong');
}
return password;
};
Hope this helps!
Pummarin
Hey there, cool code!
When a function sees a return
statement, it stops running and returns a value. This means that the code after it won’t run.
That means that the function in your code declares a local variable called password
, gives it the value 258921
, and then immediately returns it. The if statement after the return
won’t run.
Also, your function takes a parameter called mp
, but isn’t using it anywhere. Try changing your if statement to if (mp === password)
.
Hope this helps!
Ben
Sorry, I am coding JavaScript. So I can't answer accurately.