JavaScript Simplified

Umme Salma Ali
3 min readMay 5, 2021

Well, To know more about JavaScript, first of all we should know about the history behind why JavaScript is very popular now-a-days. JavaScript is a very powerful language in the programming world. But it was quite underrated when it was introduced for the first time being. A young guy named Brendan Eich introduced JavaScript introduced in 1995. Because of some marketing policy it was renamed which was about to named Livescript and that made it too confusing.

In this article, I am going to cover some of the essential features of JavaScript.

Contents of JavaScript to be discussed:

  1. Number
  2. String
  3. Boolean
  4. Object
  5. Function
  6. Anonymous Function
  7. Array
  8. Symbol
  9. Null
  10. Undefined

These topics have been covered in the following:

1.Number: JavaScript Follows single type of Number. Numbers can be presented either with decimals or without decimals. i.e.

var a = 5.14 | demonstrates a number with decimal.
var b= 5 | demonstrates a number without decimal.

2.String: String refers to any text wrapped with single or double quotation. In JavaScript, string contains a series of letters or characters like

“Umme”, ‘’Salma”, “Ali”.

3. Boolean: JavaScript follows Boolean data structure. In JavaScript, programmers need data type which has two values. It would be either

true or false, on or off, yes, or no.

4.Object: We already know that JavaScript variables are containers for data values. We can define objects as variables too. But whereas variables can contain single value, an object can contain multiple values. i.e.

var laptop = {brand:” Lenovo”, price:”50000", color: ”silver”};

5.Function: JavaScript function contains a block of codes which performs a particular task. The function starts it’s execution once it is called (). i.e.

function demoFunction(x,y){
return x + y
}
demoFunction(20,30)

So whenever we need to execute the function we just call that function and it’ll starts it’s functionality.

6.Anonymous Function: An anonymous function is a function without a name. An anonymous function is not often accessible after it’s initial creation. The following demonstration is an example of anonymous function:

let demo = function(){

console.log(“anonymous function”)

}

demo();

Since we need to call the anonymous function afterwards, we assign the function to the demo variable.

7.Array: It is a special type of variable which is used to store more than one variable at a time. By declaring an array you don’t need to write var separately for every values. So we can say that JavaScript Arrays are used to store multiple variables within a single variable.

var laptop =[ macbookAir, lenovo, dell, hp, asus, acer]

8.Symbol: Symbol is the newest JavaScript primitive which has brought some benefits to the programming language and is particularly useful when used as object property. So a symbol is a value which is not possible to be recreated. Symbol has one more essential use. Symbol can be used as keys in objects. i.e.

const value1 = Symbol(“hello”);

const value2 = Symbol(‘‘hello’’);

console.log(value1 === value2);

9.Null: The JavaScript Specification speaks about null:

‘’ Null is a primitive value that represents the international absence of any object value’’

For example if you see a null that was assigned to a variable or returned by a function, then at that place there should have been an object, but for some reason an object was not created.

10.Undefined: Undefined is also a primitive value in JavaScript. A variable or an object has an undefined value when no value is assigned before using it. So we can say that undefined refers to lack of value or unknown value.

var demo;

alter(demo) //undefined

--

--

Umme Salma Ali
0 Followers

A curious programmer who always want to explore more about new technology and wanna stay updated with technology.