Home arrow JavaScript arrow The Power of Javascript: Basic Types of Data

The Power of Javascript: Basic Types of Data

Javascript interpreters understand two different, basic types of data: numbers and character strings. But interpreters only understand these data types when they are presented in certain ways. This article, the third in a series, will explain what these types of data are, and how to handle them.

Author Info:
By: Michael Youssef
Rating: 4 stars4 stars4 stars4 stars4 stars / 30
July 12, 2005
  1. · The Power of Javascript: Basic Types of Data
  2. · Data as Numbers
  3. · Boolean Data, Yes or No
  4. · One Small Change

print this article

The Power of Javascript: Basic Types of Data
(Page 1 of 4 )

We are still at the stage of examining basic concepts in Javascript. In this article we are going to learn about the basic types of data that Javascript interpreters understand and manipulate. Programming languages differentiate between the various data we store and manipulate. To help you understand what I mean, suppose that we need to add two values and store the result in a variable. These values may be one of the following pairs:

45, 87
"Hello", 23
"Hi", "Name"

So when we use the plus symbol (which is called an operator in Javascript, and will be discussed with the other available operators in the following articles) with the first pair ( 45 + 87 ), Javascript understands that we are performing an addition operation on numbers. When we use the plus symbol with the third pair (the characters text), it understands that we need to perform an operation called concatenation, which produces a text of the first value and the second value together. If we concatenate "Hi" + "Name" it produces one text, "HiName."

We will talk more about the double quotes and why we put them in, but for now we need to understand that programming languages must differentiate between numbers and text because, as you will see in this article, the operations (like the addition operation) produce different values depending on the type of data we are dealing with (numbers or text), which are called basic data types because they are the simplest form of data that we can manipulate. The second pair is discussed with an example in this article because it's an interesting example for a Javascript beginner.

blog comments powered by Disqus

- 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 

Developer Shed Affiliates


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