What's wrong with my code?



It doesn't show any errors, but after I try to run the program, the result is unsatisfied, the problem occurs when it comes to 'yes' and 'no' for each answer

var user = prompt("You are facing a troll and he's going to eat you. What would you like to do?FIGHT, RUN, OR PAY him?").toUpperCase();

switch (user) {
    case 'FIGHT':
        var strong= prompt("Are you strong enough?").toUpperCase;
        var smart= prompt("Are you smart?").toUpperCase;
        if (strong === 'YES' || smart==='YES') {
        console.log("You're either strong or smart, you can beat him easily!");
        }else {
        console.log("You're so dumb, You're gonna be eaten!");
    case 'PAY':
        var money =prompt("Do you have much money?").toUpperCase;
        var cur = prompt("Do you have money in troll currency?").toUpperCase;
        if (money=== 'YES' && cur ==='YES') {
            console.log("Nice! Let's pay for that b*tch and get outa here");
        } else {
            console.log("Holy sh*t! How are you supposed to do with those pennies?");
    case 'RUN':
        var run =prompt("Are you sure you can get away from him?").toUpperCase;
        if ( run) {
            console.log("Let's go")
        } else {
            console.log("Stay here and be eaten, nerd!")
        console.log("Please choose the approriate answer!");



Is it that toUpperCase is a function and needs parenthesis after it, like


Looking at it that's the only thing that pops out.


Yeah, it's a function which I use as the instruction given. I also changed the case with the sample, but I got the same result. If I change the whole code, the outcome will be different


I just ran it, the problem is that you don't have parenthesis after your .toUpperCase functions. Rewrite every




Right now you aren't actually calling the function like you think you are, which is making variables like strong or smart have weird values. If you want to see what they are before you make the changes I said, add something like

console.log(smart + " " + strong);

after you get the input for the variables