Challenge: Creating User Profile & Activity Details
Swipe to start coding
You're developing a user profile and activity tracker for a website.
-
Declare a constant called
DEFAULT_COUNTRY
with the value"United States"
. -
Declare a variable
username
and assign it"John Doe"
. -
Declare a variable
age
and set it to30
. -
Declare a variable called
country
and set it equal toDEFAULT_COUNTRY
. -
Declare a variable
isSubscribed
and set it totrue
. -
Declare a variable
loginCount
and set it to5
. -
Declare a variable
loginReward
and set it to250
. -
In the next line, increment the
loginCount
using the++
operator. -
Increase
loginReward
by50
using the+=
operator. -
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
-
Output
welcomeMessage
usingconsole.log()
.
Lösning
Tack för dina kommentarer!