10 responses to “Javascript Tutorial – Using the prompt() and Number() functions”
Im new to javascript. I have to use prompt to ask a series of 10 yes or no questions. Each question is 5 points. How do I add them up? The user will input 'yes' meaning 5 points and 'no' being 0 points. How do I go about that? How would I make the word 'yes' translate into 5 points in the code and then add up all the answers of the 10 questions?
tks for the video! One small question, I have 4 prompts with 4 questions and I want browser shows the answers after each questions. continously, at the end I have 4 answers' shown on browser. How can I do that!?
Hi can u help me ..I want to create an authentication prompt..in that prompt browser and tab will not close until type correct password and user name..plz help me
thanks for your video , you provide an easy way to learn , however please i want to set a factorial function like 5!=5*4*3*2*1 , i found on stackoverflow many functions ,but are really difficult to understand , would you like please to give us a simple solution regarding factorial please , and thank you by the way
10 responses to “Javascript Tutorial – Using the prompt() and Number() functions”
Im new to javascript. I have to use prompt to ask a series of 10 yes or no questions. Each question is 5 points. How do I add them up? The user will input 'yes' meaning 5 points and 'no' being 0 points. How do I go about that? How would I make the word 'yes' translate into 5 points in the code and then add up all the answers of the 10 questions?
Number() solved my problem, thank you for this video!
An easier way to add variables correctly is add a "+" in front of the variables
Example:
var firstNumber = 5;
var secondNumber = 5;
var sum = +firstNumber + +secondNumber;
//sum is now equal to 10
THANK YOU SO MUCH FOR THIS VIDEO!!!!!
Thanx
what is he writing in?
thsnk you very much
tks for the video! One small question, I have 4 prompts with 4 questions and I want browser shows the answers after each questions. continously, at the end I have 4 answers' shown on browser. How can I do that!?
Hi can u help me ..I want to create an authentication prompt..in that prompt browser and tab will not close until type correct password and user name..plz help me
thanks for your video , you provide an easy way to learn , however please i want to set a factorial function like 5!=5*4*3*2*1 , i found on stackoverflow many functions ,but are really difficult to understand , would you like please to give us a simple solution regarding factorial please , and thank you by the way