What's your favorite language?
Posted by Admin_Ray
15 months ago
function favoriteLanguage(language) {
    let language = prompt("What's your favorite language?", "Python, obviously");
    if (language.length < 2) {
        return "Wrong answer!";
    }
    language = language[0].toUpperCase() + language.slice(1, language.length);
    console.log(language);
    if (language !== "Python, obviously" && language !== "Python" ) {
        return "Wrong answer!";
    }
    return "Ah, I see you're a man of culture as well."
}
1
15 months ago
function favoriteLanguage(language) {

    let language = prompt("What's your favorite language?", "Python, obviously");

    if (language.length < 2) {

        return "Wrong answer!";

    }

    language = language[0].toUpperCase() + language.slice(1, language.length);

    console.log(language);

    if (language !== "Python, obviously" && language !== "Python") {

        return "Wrong answer!";

    }

    return "Ah, I see you're a man of culture as well."

}
1
NUMBER FOLLOWERS
A community for programmers (or non-programmers) to come together and let out their inner nerd.

if (user.type === "programmer" || user.type === "normie") {
  console.log(`Welcome, ${user.username}!`);
}
COMMUNITY RULES
  • 1. Anything goes.
COMMUNITY MODERATORS
None