JavaScript - Quick Tutorials

  • Posted on: 28 February 2017
  • By: vinodkumartiwari

JavaScript is an open source light weighted scripting language to develop cross-platform web and hybrid applications. JavaScript scripting is based on ECMAScript which is Scripting Language Specification by European Computer Manufacturers Association(ECMA) in 262. Programmers commonly use ECMAScript for client-side scripting. ECMAScript used for writing server applications and services using Node.js. Other implementations of ECMAScript include JScript and ActionScript. ECMAScript is the language, whereas JavaScript, JScript, and even ActionScript 3 are called dialects.

Primitive Data Types

JavaScript Defines Six Types of Primitive Data Types:

  1. Boolean
  2. Null
  3. Undefined
  4. Number
  5. String
  6. Symbol (ECMA 6)

The this Keyword in JavaScript

We cannot consider this keyword as a variable also we cannot change the value of 'this' in JavaScript. If we think the value and the scope for this we can consider the following points:

  • The keyword this in an object constructor does not have any value. It's just a substitute for the new object.
  • If we think about the values for this generally it contains the JavaScript code.
  • If we are using this inside a function then this object owns the JavaScript function itself.
  • If we are using inside an object then the value of this will be the object itself

Object Prototype

In JavaScript when we are dealing with an object we always have a prototype with the object.
The object's prototype is also an object. The inheritance of the properties and methods are fulfilled from the prototype in JavaScript.

As a best practice it is notable point that we should modify only the custom/own prototypes used in JavaScript. Modifying the JavaScript inbuilt prototypes should be discouraged.