Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Task - User Profile & Activity Details | Manipulating Data
Introduction to JavaScript
course content

Kursinhalt

Introduction to JavaScript

Introduction to JavaScript

1. Getting Started
2. Manipulating Data
3. Conditional Statements

book
Task - User Profile & Activity Details

Aufgabe

Swipe to start coding

You're developing a user profile and activity tracker for a website. In this task, you'll practice most of the concepts we looked at in the previous chapters.

Your task is to:

  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.

  1. In the next line, increment the loginCount using the ++ operator.
  2. Increase loginReward by 50 using the += operator.

  1. 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
  2. Output welcomeMessage using console.log().

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 15
toggle bottom row

book
Task - User Profile & Activity Details

Aufgabe

Swipe to start coding

You're developing a user profile and activity tracker for a website. In this task, you'll practice most of the concepts we looked at in the previous chapters.

Your task is to:

  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.

  1. In the next line, increment the loginCount using the ++ operator.
  2. Increase loginReward by 50 using the += operator.

  1. 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
  2. Output welcomeMessage using console.log().

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 15
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
Wir sind enttäuscht, dass etwas schief gelaufen ist. Was ist passiert?
some-alt