How Does Virtual DOM Work?


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>DOM Explore</h1>
</body>
</html>


function Student() {
this.name = 'Harry';
this.gender = 'Potter';
}
var studObj1 = new Student();
stdObj1.age = 15;
console.log(stdObj1.age);
// 15
var stdObj2 = new Student();
console.log(stdObj2.age)…


The reduce() method executes a reducer function on each element of the array.

arr.reduce(callback( accumulator, currentValue, [, index[, array]] )[, initialValue])
const numbers = [3, 5, 8, 9, 12];const total = numbers.reduce((accumulator, currentValue) => accumulator + currentValue, 0);console.log(total);
// 37
const numbers = [3, 5, 8, 9, 12];
const result = numbers.reduce((accumulator, currentValue)…


const printFive = () => 5;
const result = printFive();
console.log(result);
// 5
const doubleIt = number => number * 2;
const result =…


bind(), call() and apply()
const person = {
name: 'Tom',
salary: 15000,
houseRent: function (amount, vat, tax) {
return this.salary = this.salary …


An empty object can be created using one of two syntaxes:let user = new Object();
let user = {};
let user =…


The array is used to store a collection of data

let arr = new Array();
let arr = [];
// There are two syntaxes for creating an empty array
let fruits = ["Apple", "Orange", "Plum"];
alert( fruits[0] ); // Apple
alert( fruits[1] ); // Orange
alert( fruits[2] ); // Plum

Prodip Sarker

in a relationship with console.log()

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store