Question: . Within the existing script element, declare a constant called myFirstName. a . Initialize myFirstName with a suitable value ( Use your actual name )

. Within the existing script element, declare a constant called myFirstName.
a. Initialize myFirstName with a suitable value(Use your actual name).
2. Declare a variable called myAge. Make sure to utilize let.
3. Reassign myAge variable.
a. Prompt the user to input their age and store that info within the variable.
4. Declare a variable called myFuture. Make sure to utilize let.
5. Reassign myFuture variable.
a. You will want to calculate what the age will be in 30 years within the variable. Create a
calculation that will add 30 to the myAge variable and store the result within the
myFuture variable. Hint: You might need to parse the variable so it is considered a
number and not string.
6. Use a template literal to write/insert a phrase within an alert.
a. You will combine the myFirstName and myFuture variable into a phrase.
b. Example phrase: My name is Buddy and my age 30 years from now will be 60.
c. The alert will run once the page loads.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!