Learnitweb

Category: JavaScript tutorial

  • undefined in JavaScript

    1. Introduction In this tutorial, we’ll discuss undefined in JavaScript. This concept is little bit different from other popular languages like Java. In Java null is used to show absence of value. In JavaScript, people are confused about null and undefined as both look like absence of value. In this tutorial, we’ll try to explain…

  • Symbol in JavaScript

    1. Introduction In this tutorial, we’ll discuss in detail about a primitive type introduced in ECMAScript 6 – Symbol. The JavaScript already had five primitive types: string, number, boolean, null, and undefined before Symbol was introduced. In this tutorial, we’ll discuss Symbol and how to create a Symbol. We’ll also discuss about Symbol properties. But…

  • Destructuring assignment in JavaScript

    1. Introduction While working with arrays and objects sometimes we need to pull out values and assign it to distinct variables. The destructuring syntax makes it easy to do this with less code. Without destructuring it may require duplicate code. For example: You can observe, there will be repetitive code if there are more properties.…

  • const in JavaScript

    1. Introduction In this tutorial, we’ll discuss another way of declaring block-scoped constants – const. A const is similar to let with respect to scope. A const is block-scoped and can not be redeclared or reassigned a new value once declared or initialized. When you use a const to hold an array or an object…

  • let in JavaScript

    1. Introduction In this tutorial, we’ll discuss another way for declaring variables in JavaScript. First we have to discuss the problem with var which lead to the need of let. In this code, x is changed in the if block and it overrides the value of x declared outside the if block. To overcome such…

  • var in JavaScript

    1. Introduction var allows you to declare a globally-scoped or function-scoped variable. You can initialize a var variable when you declare it but it is optional. You can declare and initialize the variable in the same statement. You can do declare and initialize two variables in the same line. You can assign same value to…

  • Immediately-invoked Function Expressions (IIFE) In JavaScript

    1. Introduction An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined. An IIFE looks like the following: Let us understand IIFE with the help of an example. In the above code: there is no name of the function, it is an anonymous function. anonymous function is…

  • Hoisting in JavaScript

    1. Introduction In this tutorial, you’ll learn about hoisting in JavaScript. Hoisting is a very important concept to know for the JavaScript interviews. Hoisting is most commonly asked question in JavaScript interviews. We’ll discuss hoisting with respect to variable, function and classes. In JavaScript, variables and functions can be accessed before their actual declaration, and…

  • JavaScript versions

    In the early days of the Web, as the browser wars between Netscape and Microsoft heated up, Ecma International, formerly the European Computer Manufacturers Association (ECMA), agreed to take on JavaScript as a standard. Because of Sun’s ownership of the JavaScript name, ECMA adopted ECMAScript as the official name. However, virtually everyone uses JavaScript. As…

  • Introduction to JavaScript

    JavaScript is the programming language of the Web. Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web. JavaScript is dynamic, high-level, untyped interpreted language. JavaScript has object oriented and functional features as well. JavaScript was created at Netscape. The programs written in JavaScript can run on browser. Today,…