This is what I am trying to accomplish in javascript,
Write a while loop that will prompt the user if they would like to print their name. If the
answer is yes, log their name to the console then prompt them if they would like to print
their name again. If yes, log their name to the console again but this time add an
exclamation point at the end of the string. Continue to add an exclamation point for every
time the user agrees to wanting to print his or her name.
Prompt: ‘Would you like to print your name?’ > ‘yes’
Output: ‘Hello. My name is Adam’
Prompt: ‘Would you like to print this again?’ > ‘yes’
Output: ‘Hello. My name is Adam!’
Prompt: ‘Would you like to print this again?’ > ‘yes’
Output: ‘Hello. My name is Adam!!’
Prompt: ‘Would you like to print this again?’ > ‘no’
This is what I have so far but it wont loop back and I am not sure how to make a string that will add the exclamation point.
var a= prompt(“would you like to print your name”);
while(a===“yes”, c===“yes”);{
var b= prompt(“what is your name?”);
var c= prompt(“would you like to print this again?”);
}
console.log(b + “!”);