Home arrow JavaScript arrow Page 3 - The Power of Javascript: Basic Concepts
JAVASCRIPT

The Power of Javascript: Basic Concepts


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.

Author Info:
By: Michael Youssef
Rating: 4 stars4 stars4 stars4 stars4 stars / 30
July 05, 2005
TABLE OF CONTENTS:
  1. · The Power of Javascript: Basic Concepts
  2. · Javascript Comments
  3. · Javascript Statements
  4. · Keywords
  5. · Identifiers
  6. · White Spaces and Case Sensitivity

print this article
SEARCH DEVARTICLES

The Power of Javascript: Basic Concepts - Javascript Statements
(Page 3 of 6 )

As you know, a script is executed line by line downward exactly as we read English. Take a look at the following English sentences:

Bring a piece of paper.

Bring a pen.

Write "Hello Dear."

When we read these sentences, we write them downward, or if they are all in the same line we will begin with the first one, then the second one, then the third and so on. A sentence in English has meaning; say "Bring me a piece of paper" to your friend, for instance, and he will give you a piece of paper. The sentence is terminated by the full stop symbol (.).

The same rules apply to Javascript. The English sentences are called statements in Javascript, and they execute downward. A Javascript statement is terminated with a semicolon (;) (you don't have to put it in, but for now let's just say that it's a good practice to terminate each statement with it). A statement instructs the interpreter to do something, like this statement:

var x = 2 + 1;

This statement adds 2 and 1, then puts the result in a memory place called x. We will discuss all these concepts in detail so you don't have to worry about how you can create such statements. This is enough to know about Javascript statements for now. 

A Fast Look at Variables

To be able to continue with our discussion about the concepts in this article we must take a fast look at variables. The script statements (instructions) have to work on data; this is what programming is all about. We need a way to store data in the memory and operate on it.

A variable is a block of memory that is used to store data. It is called a variable because the value that's stored inside it can be changed.

Say that we have a memory location called x and we stored the value 243 in it. After a few statements in the script the value of x (which is 243) has been changed by a statement to the value 10, and after another three statements it has been changed to the value 567, and so on. So a variable is a memory location that we use to store data that we will operate on. What I mean by operate on is that we can add or multiply the value by another value, and perform may other operations on the value that we will learn about in the series. To declare that your script needs a memory location to store some data, we need to understand two important basic concepts in Javascript: keywords and identifiers.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials