Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Creating User Profile & Activity Details | Manipulating Data
Introduction to JavaScript

Pyyhkäise näyttääksesi valikon

book
Challenge: Creating User Profile & Activity Details

Tehtävä

Swipe to start coding

You're developing a user profile and activity tracker for a website.

  1. Declare a constant called DEFAULT_COUNTRY with the value "United States".

  2. Declare a variable username and assign it "John Doe".

  3. Declare a variable age and set it to 30.

  4. Declare a variable called country and set it equal to DEFAULT_COUNTRY.

  5. Declare a variable isSubscribed and set it to true.

  6. Declare a variable loginCount and set it to 5.

  7. Declare a variable loginReward and set it to 250.

  8. In the next line, increment the loginCount using the ++ operator.

  9. Increase loginReward by 50 using the += operator.

  10. Declare a variable welcomeMessage that joins the following strings using the + operator in order:

    • username
    • " is "
    • age
    • " years old and has logged in "
    • loginCount
    • " times. The Login Reward balance is "
    • loginReward
  11. Output welcomeMessage using console.log().

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 15
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?

Kysy tekoälyä

expand
ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

book
Challenge: Creating User Profile & Activity Details

Tehtävä

Swipe to start coding

You're developing a user profile and activity tracker for a website.

  1. Declare a constant called DEFAULT_COUNTRY with the value "United States".

  2. Declare a variable username and assign it "John Doe".

  3. Declare a variable age and set it to 30.

  4. Declare a variable called country and set it equal to DEFAULT_COUNTRY.

  5. Declare a variable isSubscribed and set it to true.

  6. Declare a variable loginCount and set it to 5.

  7. Declare a variable loginReward and set it to 250.

  8. In the next line, increment the loginCount using the ++ operator.

  9. Increase loginReward by 50 using the += operator.

  10. Declare a variable welcomeMessage that joins the following strings using the + operator in order:

    • username
    • " is "
    • age
    • " years old and has logged in "
    • loginCount
    • " times. The Login Reward balance is "
    • loginReward
  11. Output welcomeMessage using console.log().

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 15
Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt