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_COUNTRYwith the value"United States". -
Declare a variable
usernameand assign it"John Doe". -
Declare a variable
ageand set it to30. -
Declare a variable called
countryand set it equal toDEFAULT_COUNTRY. -
Declare a variable
isSubscribedand set it totrue. -
Declare a variable
loginCountand set it to5. -
Declare a variable
loginRewardand set it to250. -
In the next line, increment the
loginCountusing the++operator. -
Increase
loginRewardby50using the+=operator. -
Declare a variable
welcomeMessagethat 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
welcomeMessageusingconsole.log().
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 1.33
Challenge: Creating User Profile & Activity Details
Sveip for å vise menyen
Swipe to start coding
You're developing a user profile and activity tracker for a website.
-
Declare a constant called
DEFAULT_COUNTRYwith the value"United States". -
Declare a variable
usernameand assign it"John Doe". -
Declare a variable
ageand set it to30. -
Declare a variable called
countryand set it equal toDEFAULT_COUNTRY. -
Declare a variable
isSubscribedand set it totrue. -
Declare a variable
loginCountand set it to5. -
Declare a variable
loginRewardand set it to250. -
In the next line, increment the
loginCountusing the++operator. -
Increase
loginRewardby50using the+=operator. -
Declare a variable
welcomeMessagethat 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
welcomeMessageusingconsole.log().
Løsning
Takk for tilbakemeldingene dine!
single