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 valueUse your actual name
Declare a variable called myAge. Make sure to utilize let.
Reassign myAge variable.
a Prompt the user to input their age and store that info within the variable.
Declare a variable called myFuture. Make sure to utilize let.
Reassign myFuture variable.
a You will want to calculate what the age will be in years within the variable. Create a
calculation that will add 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.
Use a template literal to writeinsert 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 years from now will be
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
