The Cellar  

Go Back   The Cellar > Main > Technology
FAQ Community Calendar Today's Posts Search

Technology Computing, programming, science, electronics, telecommunications, etc.

Reply
 
Thread Tools Display Modes
Old 03-23-2004, 12:14 PM   #1
hot_pastrami
I am meaty
 
Join Date: Dec 2001
Location: Salt Lake City, UT
Posts: 1,119
Beginners, you may gloss over this reply if you like, we'll cover this stuff soon enough.

Quote:
Originally posted by Radar
Do you have to declare your variable types such as a string, a whole number etc?
Not in Javascript... in Javascript, a basic variable can contain a boolean, a character, a number, or a string. In more advanced languages, this distinction is necessary, but not in JS.

Quote:
Originally posted by Radar
In the example of madlibs code, what are the commands for input and output of strings such as the "get" command?
Javascript have a built-in function called prompt() which asks the user for a value, and returns it. That's how we'd retreive the words from the user. We can then print those back out to the browser with a document.write() command.

Quote:
Originally posted by Radar
Does a double equal sign == mean not equal to?
No... a double equal is the test operator... if (myNumber == 10). A single equal is the assignment operator... myNumber = 15; If you want to test for Not Equals, you use the != operator.

A post on Javascript operators will be coming up shortly.
__________________
Hot Pastrami!
hot_pastrami is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 03:03 PM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.