ES6

JavaScript – ES6 Features

ES6 Features: ES6 brought significant changes to the JavaScript language. It introduces several new features such as, block-scoped variables, new loop for iterating over arrays and objects, template literals, and many other enhancements ES6 features are:

JavaScript – Var-Let-Const

Var Let Const Variable can be either Global Scope or Local Scope Variable is Local scope Variable is Local Scope Re-Declaration or Updating of variable is possible Only Updating possible Nothing is possible. Hoisting allowed – Variables initializes with “undefined” Hoisting allowed – Variables not initializes with values. Hoisting allowed – Variables not initializes with …

JavaScript – Var-Let-Const Read More »

JavaScript – Arrow Functions

Lambda expression: Anonymous functions: Method example: Lambda expression: Lambda expression with zero arguments: Lambda expression with input values: Lambda expression with return values: Can be defined simply like: Program to define Arrow function to perform multiplication operation: Arrow function can be define in more than one statement using {  }

Java Script – For/OF Loop

For/Of Loop: Note: Generally, we iterate an array by specifying their index values. In case of For/Of loop, no need to specify the index to iterate the elements of Array or Collection: We can iterate any type of array using for/of easily: Limitations: For/of loop can process elements only in forward direction. For/of loop can …

Java Script – For/OF Loop Read More »

Java Script – Set

Array: Set: Map: Set object methods: new Set() Creates a new set add()  Adds element to set delete()  removes specified element from set hash() returns true if the value exists clear() remove all elements forEach() invokes each element values()  returns an iterator with all values keys()  same as values() entries()  returns [key, value] pairs in …

Java Script – Set Read More »

JavaScript – Map

Map: For example, we process accounts using account numbers because names can be duplicated but account numbers must be unique. Map object providing pre-defined methods to process: Clear() removes all elements from map object Delete(key) removes element associated with specified key. Get(key) returns the element associated with the key Has(key) returns true if value associated …

JavaScript – Map Read More »

JavaScript – Classes and Objects

Class: Object: Banking Application: Account class – Number of Account Holders (objects) Constructor(): Create Object and Print details: Create multiple objects and print details using method:

JavaScript – Date Object

Date object: It is providing methods to display system date and time. Formatting Date: Date object providing methods to get values of month, week, day, hour etc.. Note: we need to concatenate if the value is single digit Program to display Date and Time:

JavaScript – Math Object

Math object: Providing number of pre-defined methods to perform simple mathematical operations on data. Math.sqrt() method: Math.random() method: Generate random numbers Math.pow(m, n): find m^n value Math.floor() : Math.ceil(): Math.round(): Math.trunc(): it returns only Integer part of specified decimal value             Math.trunc(4.9);   // returns 4 Math.sign(): Example: Math.sign(-4) : returns -1 Math.cbrt() : returns cube …

JavaScript – Math Object Read More »

Scroll to Top