What is wrong with this?

What is wrong with this?

Hey there, @Meg_G. It looks like the return statement is before the if...else statement. Try moving it below the if...else statement and between the last curly brace }, like this:

var passwordimput = 23006001803400;

function password(mp) {
    let password = 258921;
    if (passwordimput === password) {
        print('nice! you got it right!');
    } else {
        print('sorry, your wrong');
    return password;

Hope this helps!
Pummarin :slightly_smiling_face:

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!

Sorry, I am coding JavaScript. So I can't answer accurately.