Basic Concepts of JavaScript?

I need a list of some important javascript concepts.

Here you can get a very useful javascript concepts where most of the people get confused or not aware of it. The below list will solve it:


What is NaN?

NaN represents a special Not-a-Number value. It is a result of an invalid or an undefined mathematical operation, 

like taking the square root of -1 or dividing 0 by 0, etc.

We can check it using Number.isNaN() or Double.isNaN() etc.


    alert("Some text" / 2);       // Output: NaN

    alert("Some text" / 2 + 10);  // Output: NaN

    alert(Math.sqrt(-1));         // Output: NaN


What is undefined?

It is a data type in javascript, The undefined data type can only have one value-the special value undefined. If a variable has been declared, 

but has not been assigned a value, has the value undefined.



    var a;

    var b = "Hello World!"


    alert(a) // Output: undefined

    alert(b) // Output: Hello World!


What is null?

This is another special data type that can have only one value-the null value. A null value means that there is no value. 

It is not equivalent to an empty string ("") or 0, it is simply nothing. 



    var a = null;

    alert(a); // Output: null

    var b = "Hello World!"

    alert(b); // Output: Hello World!

    b = null;

    alert(b) // Output: null


   What is TypeScript? 

TypeScript extends JavaScript by adding types.

By understanding JavaScript, TypeScript saves you time catching errors and providing fixes before you run code.

TypeScript stands in an unusual relationship to JavaScript. TypeScript offers all of JavaScript’s features, and an additional layer on top of these: TypeScript’s type system.

For example, JavaScript provides language primitives like string, number, and object, but it doesn’t check that you’ve consistently assigned these. TypeScript does.

This means that your existing working JavaScript code is also TypeScript code. The main benefit of TypeScript is that it can highlight unexpected behavior in your code, lowering the chance of bugs.


What is ES6?  

ECMAScript was created to standardize JavaScript, and ES6 is the 6th version of ECMAScript, it was published in 2015, and is also known as ECMAScript 2015. It has introduced many new features like class, arrow functions, spread operator, rest parameter etc.


What is Angular CLI?  

Angular CLI is a great tool to create and work with Angular Applications . It takes away all the pain staking work one has to do otherwise manually by making all the configuration files required for bootstrapping an angular application. With few commands it becomes easier to build working components, Services, directives etc .

Angular cli makes it easier to work in angular environment. As it contains whole bunch of commands to create core building blocks of angular and to even unit -testing them.