A global variable is any variable declared outside of a function, while a local variable
is any variable declared inside of a function. These are the only two types. A global
variable can be used anywhere, but a local variable can only be used/called upon inside of its function.
If you try to use a variable that you declared inside a function (a local variable) outside of that function,
it will not work.
Just like with XHTML, JavaScript offers a way to insert
comments. They are a means
to insert ideas, thoughts, and such, without effecting the page during load time. To insert a comment in JavaScript, hit
forward slash twice "//" followed by whatever you want to leave as a note. This will only give you one line to make a comment,
so when you enter to the next line, you are no longer in the safety of a comment. For a multi-line comment, type "/*" followed
by however many lines of text that you desire. To end the comment type "*/" and this will stop your comment.
Comments look like this:
This page was constructed by Isaac Duke, a student of Anderson University, for an independent study in web programming.
This is not a fully comprehensive primer, so use in conjunction with other resources (resource page provided). The last
time this site has been updated was on August 20, 2013. If any questions, email misaacduke@gmail.com