well threre are some bugs im working on because when you actually type the second sector of coding lines for example
the first line lets make it: var num1=prompt(num—-blalalblal
but then when you try to repeat the same code but with difrent sing for example / division / multiplication * or any other sing it give syou false numbers im try to fix it so that way all bugs will be gone lol and hey keep up the good work nice vids by th way
the prompt returns the message as a type “string”. So it treats the input the same way as it would text. You cant “add” strings, the + operator concatenates them, adding them to the end of each other. To output the sum of 1 + 1, you need to state that they are of number types.
December 31st, 2008 - 01:02
do u know how to work java script for SAM Broadcaster 3
January 4th, 2009 - 01:02
how do you make a regular message to the use without the “script prompt to do it?
January 23rd, 2009 - 19:39
it doesn’t seem to work if you use +
February 8th, 2009 - 13:53
use this:
alert (Number(num1) + Number(num2));
should work fine…
March 18th, 2009 - 18:04
Hey, i find your videos really helpful. thanks alot
April 6th, 2009 - 08:51
What’s to keep the user from entering a string of text instead of a number?
April 15th, 2009 - 20:19
actually if you type alert (num1*num2);
alert (num1+num2);
alert (num1/num2);
what it dows is that it gives you the results for the adition because we put a + sing and division because we also put a / sing
its preatty awsome
April 15th, 2009 - 20:42
well threre are some bugs im working on because when you actually type the second sector of coding lines for example
the first line lets make it: var num1=prompt(num—-blalalblal
but then when you try to repeat the same code but with difrent sing for example / division / multiplication * or any other sing it give syou false numbers im try to fix it so that way all bugs will be gone lol and hey keep up the good work nice vids by th way
April 22nd, 2009 - 01:58
keep doin wat ur doing.Its really helping.
Thanks alot
May 9th, 2009 - 20:51
Thanks
July 24th, 2009 - 20:31
your website is down
August 8th, 2009 - 17:15
its just like a video now?
August 20th, 2009 - 05:18
Mike Jones lol
August 25th, 2009 - 23:58
Wow, you make things MUCH easyier! I rated and subscribed!
September 3rd, 2009 - 09:30
I’m taking a course and I don’t know what the hell my teacher is doing. But you make sense. Thanks.
September 4th, 2009 - 01:19
if you type (num1+num2);
it puts the two number together like 1 + 1 = 11
October 8th, 2009 - 00:13
That’s if num1 and num2 are strings. If you want to add the numbers in strings you can do: parseInt(num1)+parseInt(num2)
October 29th, 2009 - 01:23
That was some awesome vid you had!
December 26th, 2009 - 09:10
Im working on a question game that uses prompt and alerts so I need to watch JavaScript.
P.S
Your tutorials on JavaScript are the best!!!!
December 26th, 2009 - 09:11
It alsow uses if else statements
January 6th, 2010 - 20:39
hey u r amaizing person
god bless u and ur family
but what is notepad++
i have normal one and i want to get the same software u have.
January 28th, 2010 - 02:46
your tutorials are the best, but 1+1 is 11…how could i solve that problem? thanks in advance..God Bless..
February 1st, 2010 - 15:47
@Chopinsiblos.
You are using the + operator in ur variable that is why you are getting 11, it is just adding 1 to 1, you want to use the * operator.
February 3rd, 2010 - 13:42
the prompt returns the message as a type “string”. So it treats the input the same way as it would text. You cant “add” strings, the + operator concatenates them, adding them to the end of each other. To output the sum of 1 + 1, you need to state that they are of number types.
February 3rd, 2010 - 13:47
try this…
var num1 = parseInt(prompt(”Enter num1″));
var num2 = parseInt(prompt(”Enter num2″));
var answer = (num1 + num2);
alert(answer);
now the input is “parsed” as an integer rather than a string. Google javascript to string for more information.