The best way to learn any programming language is by practice. Javascript is not an exception to this rule, so we will introduce a lot of code in the articles of this series. In this article, you will be introduced to the very basic concepts of the Javascript language. We discuss comments, keywords, identifiers, statements and the semicolon, case sensitivity and white spaces. Note that our examples at this time are limited and we will focus more on the concepts, but after a few articles we are going to discuss many examples on each concept.
The Power of Javascript: Basic Concepts - Keywords (Page 4 of 6 )
The English language (or any other thing that we can call a language) is made up of words that have special meaning to the people who speak the language. The same thing applies to Javascript. There is a set of words that is used by the Javascript interpreter; these words have special meaning and are used to perform operations. We call these words keywords or reserved keywords.
To explain what a keyword can do in a script, say we need to declare a memory location. To do so, we need to use the Javascript keyword var (wait until we discuss identifiers, and we will complete it). The following is the list of keywords reserved by the Javascript language. This means that they have been reserved for use by the Javascript language and you can't use them; again you will understand this better as we go on.
break
case
continue
catch
default
delete
do
else
finally
for
function
if
in
instanceof
new
return
switch
this
throw
try
type
var
void
while
with
So in our example we have var as a keyword. Also, document is considered a keyword, but I will not discuss it now. The following list is another set of keywords that are reserved for Javascript for future use. You can say that they're reserved to add more functionality to the Javascript language.