Fallinfo
Statements
var
var
var x = 5; 
var x = 5.10; 
var x = "hello"; 
var x = true; 
var x = x + x;
let
let
var x = 10;
  {
    let x = 2;
      // Function scope
  }
const
const
var x = 10;
  {
    const x = 2;
      // Function scope
      // Static
  }
                
if
if
if (1 < 10) {
  // Code
}
if (1 < 10) {
  // Code
} else {
  // Code
}
if (1 < 10) {
  // Code
} else if (1 < 20) {
  // Code
} else {
  // Code
}
for
for
for (var i = 0; i < 5; i++) {
  // Code
}
var obj = {aa:"aa", bb:"bb"};

for (var x in obj) {
  // Code
}
var arr = ['aa', 'bb'];

for (var x of arr) {
 // Code
}
var txt = 'Fallinfo';

for (var x of txt) {
 // Code
}

while
while
var i = 0;
while (i < 10) {
  // Code
  i++;
}
var i = 0;
do {
  // Code
  i++;
}
while (i < 10);
switch
switch
var x = 2;
switch (x) {
  case (0):
    {
      // Code
      break;
    }
  case (1):
    {
      // Code
      break;
    }
  case (2):
    {
      // Code
      break;
    }
  default:
    {
      // Code
    }
}
                
return
return
function fn() {
  return 'Fallinfo';
}
break
break
for (var i = 0; i < 10; i++) {
  if (i === 3) { 
    break; 
    // Stop looping
  }
  // Code
}
continue
continue
for (var i = 0; i < 10; i++) {
  if (i === 3) { 
    continue; 
    // Skip current iteration
  }
  // Code
}
try
try
try {
  xalert("fallinfo");
}
catch(err) {
  // err.name;
  // err.message;
}
finally {
  // Default fn
}
                
try { 
  if(1 < 10) throw "Error";
}
catch(err) {
  // err
}
                
debugger
debugger
function fn() {
  // Code
  debugger;
  // Stop in dev mode
}
                
Array
arr.concat()
arr.concat()
var arr1 = ["aaa","bbb"];
var arr2 = ["ccc","ddd"];
var x = arr1.concat(arr2);
// ["aaa","bbb","ccc","ddd"]


var arr1 = ["aaa","bbb"];
var arr2 = ["ccc","ddd"];
var arr3 = ["eee","fff"];
var x = arr1.concat(arr2,arr3);
// ["aaa","bbb","ccc","ddd","eee","fff"]

// arr1.concat(arr2, arr3, ..., arrX)
                
arr.join()
arr.join()
var arr = ["aaa","bbb"];
var x = arr.join();
// aaa,bbb


var arr = ["aaa","bbb"];
var x = arr.join("-");
// aaa-bbb

// arr.join(separator)
                
arr.entries()
arr.entries()
var arr = ["aaa","bbb"];
var x = arr.entries();
for (item of x) {
  // 0,aaa
  // 1,bbb
}

// Array Iterator object with key/value pairs.
                
arr.keys()
arr.keys()
var arr = ["aaa","bbb"];
var x = arr.keys();
for (item of x) {
  // 0
  // 1
}

// Array Iterator object with the keys of an array.
                
arr.every()
arr.every()
var arr = [1,2,3,4,5,6];
function TEST(val, index, arr) {
  return val >= 3;
}
var x = arr.every(TEST);
// false

// Checks if all elements in an array pass a test
// arr.every(Function, thisValue)
                
arr.some()
arr.some()
var arr = [1,2,3,4,5,6];
function TEST(val, index, arr) {
  return val >= 3;
}
var x = arr.some(TEST);
// true

// Checks if any of the elements in an array pass a test
// arr.some(Function, thisValue)
                
arr.filter()
arr.filter()
var arr = [1,2,3,4,5,6];
function TEST(val, index, arr) {
  return val >= 3;
}
var x = arr.filter(TEST);
// [3,4,5,6]

// Creates an array with all values that pass a test
// arr.filter(Function, thisValue)
                
arr.map()
arr.map()
var arr = [1,2,3,4,5,6];
function TEST(val, index, arr) {
  return val * 2;
}
var x = arr.map(TEST);
// [2,4,6,8,10,12]

// Creates an array with modified result
// arr.map(Function, thisValue)
                
arr.forEach()
arr.forEach()
var arr = [1,2,3,4,5,6];
function TEST(val, index, arr) {
  // Code
}
var x = arr.forEach(TEST);

// Method calls a function once for each element in an array
// arr.forEach(Function, thisValue)
                
arr.find()
arr.find()
var arr = [1,2,3,4,5,6];
function TEST(val, index, arr) {
  return val >= 3;
}
var x = arr.find(TEST);
// 3

// Returns the value of the first element in an array that pass a test
// arr.find(Function, thisValue)
                
arr.findIndex
arr.findIndex
var arr = ['1,2,3,4,5,6'];
function TEST(val, index, arr) {
  return val >= 3;
}
var x = arr.findIndex(TEST);
// 2 - index value

// Returns the index of the first element in an array that pass a test
// arr.findIndex(Function, thisValue)
                
arr.indexOf()
arr.indexOf()
var arr = ["aaa","bbb","aaa","bbb"];
var x = arr.indexOf("bbb");
// 1


var arr = ["aaa","bbb","aaa","bbb"];
var x = arr.indexOf("ccc");
// -1

// arr.indexOf(item, start)
                
arr.lastIndexOf()
arr.lastIndexOf()
var arr = ["aaa","bbb","aaa","bbb"];
var x = arr.lastIndexOf('bbb');
// 3


var arr = ["aaa","bbb","aaa","bbb"];
var x = arr.lastIndexOf('ccc');
// -1

// arr.lastIndexOf(item, start)
                
arr.includes()
arr.includes()
var arr = ["aaa","bbb"];
var x = arr.includes("bbb");
// true

// arr.includes(element, start)
                
arr.push()
arr.push()
var arr = ["aaa","bbb"];
arr.push("ccc");
// ["aaa","bbb","ccc"]

// arr.push(item1, item2, ..., itemX)
                
arr.unshift()
arr.unshift()
var arr = ["aaa","bbb"];
arr.push("ccc");
// ["ccc","aaa","bbb"]

// arr.unshift(item1, item2, ..., itemX)
                
arr.pop()
arr.pop()
var arr = ["aaa","bbb"];
arr.pop();
// ["aaa"]
                
arr.shift()
arr.shift()
var arr = ["aaa","bbb"];
arr.shift();
// ["bbb"]
                
arr.reduce()
arr.reduce()
var arr = [1,2,3,4,5,6];
function TEST(total,val, index, arr) {
  return total + val;
}
var x = arr.reduce(TEST);
// 21

// Reduces the array to a single value
// arr.reduce(Function, initial_value)
                
arr.reduceRight()
arr.reduceRight()
var arr = [1,2,3,4,5,6];
function TEST(total,val, index, arr) {
  return total + val;
}
var x = arr.reduceRight(TEST);
// 21

// Reduces the array to a single value from right-to-left
// arr.reduceRight(Function, initial_value)
                
arr.reverse()
arr.reverse()
var arr = ["aaa","bbb"];
arr.reverse();
// ["bbb","aaa"]
                
arr.sort()
arr.sort()
var arr = ["aaa","bbb","ddd","ccc"];
arr.sort();
// ["aaa","bbb","ccc","ddd"]


var arr = [40, 100, 1, 5, 25, 10];
arr.sort(TEST);
function TEST(a, b){
  return a-b
}
// [1,5,10,25,40,100]

// arr.sort(compareFunction)
                
arr.slice()
arr.slice()
var arr = ["aaa","bbb","ccc","ddd"];
var x = arr.slice(1,3);
// ["bbb","ccc"]

// arr.slice(start, end)
                
arr.splice()
arr.splice()
var arr = ["aaa","bbb","ccc","ddd"];
var x = arr.splice(2, 0, "xxx", "yyy");
// ["aaa","bbb","xxx","yyy","ccc","ddd"]

// arr.splice(index, howmany_to_remove, item1, ....., itemX)
// adds/removes items to/from an array
                
arr.copyWithin()
arr.copyWithin()
var arr = ["aaa","bbb","ccc","ddd"];
var x = arr.copyWithin(2,0);
// ["aaa","bbb","aaa","bbb"]


var arr = ["aaa","bbb","ccc","ddd"];
var x = arr.copyWithin(2,1,2);
// ["aaa","bbb","aaa","ddd"]

// arr.copyWithin(target, start, end)
// copies array elements to another position in the array, overwriting the existing values
                
arr.fill()
arr.fill()
var arr = ["aaa","bbb"];
arr.fill("xxx");
// ["xxx","xxx"]


var arr = ["aaa","bbb","ccc","ddd"];
arr.fill("xxx",1,2);
// ["aaa","xxx","ccc","ddd"]

// array.fill(value, start, end)
                
.from()
var txt = ABCDEFG";
var x = Array.from(txt);
// ["A","B","C","D","E","F","G"]


var txt = "ABCDEFG";
var x = Array.from(txt,TEST);
function TEST(val, index){
  return val.toLowerCase();
}
// ["a","b","c","d","e","f","g"]

// returns an Array object from any object with a length property or an iterable object
// Array.from(object, mapFunction, thisValue)
                
.isArray()

              
arr.toString()
arr.toString()
var arr = ["aaa","bbb"];
var x = arr.toString();
// ["aaa","bbb"]
                
arr.valueOf()
arr.valueOf()
var arr = ["aaa","bbb"];
var x = arr.valueOf();
// ["aaa","bbb"]
                
arr.length
arr.length
var arr = ["aaa","bbb"];
var x = arr.length;
// 2
                
Json
.parse()
.parse()
var obj = JSON.parse('{"aaa":"aaa", "bbb":"bbb"}');
var x = obj.aaa;
// aaa

var str = "{"aaa":"aaa", "bbb":"bbb"}";
var obj = JSON.parse(str, function (key, value) {
  if (key == "bbb") {
    return value.toUpperCase();
  } else {
    return value;
  }
});
var x = obj.bbb;
// BBB

// String to object
// JSON.parse(str, reviver function)
                        
.stringify()
.stringify()
var obj = { "aaa":"aaa", "bbb":"bbb"};
var x = JSON.stringify(obj);
// { "aaa":"aaa", "bbb":"bbb"}


var obj = { "aaa":"aaa", "bbb":"bbb"};
var X = JSON.stringify(obj, function (key, value) {
  if (key == "bbb") {
    return value.toUpperCase();
  } else {
    return value;
  }
});
// { "aaa":"aaa", "bbb":"BBB"}

// Object to string
// JSON.stringify(obj, replacer, space)
                        
Boolean
bool.toString()
bool.toString()
var bool = true;
var x = bool.toString();
// true
                        
bool.valueOf()
bool.valueOf()
var bool = true;
var x = bool.valueOf();
// true
                        
Document / Window / Element
// when loaded
doc-win-el.addEventListener('load', fn_name(e));

doc-win-el.onload = function(){ // code )};

< element onload="code">
// when aborted
doc-win-el.addEventListener('abort', fn_name(e));

doc-win-el.onabort = function(){ // code )};

< element onabort="code">
doc-win-el.addEventListener('scroll', fn_name(e));

doc-win-el.onscroll = function(){ // code )};

< element onscroll="code">
// when mouse wheel
doc-win-el.addEventListener('wheel', fn_name(e));

doc-win-el.onwheel = function(){ // code )};

< element onwheel="code">
// when animation start
doc-win-el.addEventListener('animationstart', fn_name(e));

doc-win-el.onanimationstart = function(){ // code )};

< element onanimationstart="code">
// when animation end
doc-win-el.addEventListener('animationend', fn_name(e));

doc-win-el.onanimationend = function(){ // code )};

< element onanimationend="code">
// when animation end and another start
doc-win-el.addEventListener('animationiteration', fn_name(e));

doc-win-el.onanimationiteration = function(){ // code )};

< element onanimationiteration="code">
// when a CSS transition is canceled
doc-win-el.addEventListener('transitioncancel', fn_name(e));

doc-win-el.ontransitioncancel = function(){ // code )};

< element ontransitioncancel="code">
// when a CSS transition has completed
doc-win-el.addEventListener('transitionend', fn_name(e));

doc-win-el.ontransitionend = function(){ // code )};

< element ontransitionend="code">
// when a CSS transition is first created
doc-win-el.addEventListener('transitionrun', fn_name(e));

doc-win-el.ontransitionrun = function(){ // code )};

< element ontransitionrun="code">
// when a CSS transition has actually started
doc-win-el.addEventListener('transitionstart', fn_name(e));

doc-win-el.ontransitionstart = function(){ // code )};

< element ontransitionstart="code">
// when copied text using keybord or mouse
doc-win-el.addEventListener('copy', fn_name(e));

doc-win-el.oncopy = function(){ // code )};

< element oncopy="code">
// when cutted text using keybord or mouse
doc-win-el.addEventListener('cut', fn_name(e));

doc-win-el.oncut = function(){ // code )};

< element oncut="code">
// when pasted text using keybord or mouse
doc-win-el.addEventListener('paste', fn_name(e));

doc-win-el.onpaste = function(){ // code )};

< element onpaste="code">
// continuously when content draging
doc-win-el.addEventListener('drag', fn_name(e));

doc-win-el.ondrag = function(){ // code )};

< element ondrag="code">

// no mobile browser support except ios safari
// when content drag start
doc-win-el.addEventListener('dragstart', fn_name(e));

doc-win-el.ondragstart = function(){ // code )};

< element ondragstart="code">

// no mobile browser support except ios safari
// when content drag end
doc-win-el.addEventListener('dragend', fn_name(e));

doc-win-el.ondragend = function(){ // code )};

< element ondragend="code">

// no mobile browser support except ios safari
// when content drag droped in valid area
doc-win-el.addEventListener('dragenter', fn_name(e));

doc-win-el.ondragenter = function(){ // code )};

< element ondragenter="code">

// no mobile browser support except ios safari
// when content drag leaved the valid area
doc-win-el.addEventListener('dragleave', fn_name(e));

doc-win-el.ondragleave = function(){ // code )};

< element ondragleave="code">

// no mobile browser support except ios safari
// continuously when content draging over the valid area
doc-win-el.addEventListener('dragover', fn_name(e));

doc-win-el.ondragover = function(){ // code )};

< element ondragover="code">

// no mobile browser support except ios safari
// when content draging dropped
doc-win-el.addEventListener('drop', fn_name(e));

doc-win-el.ondrop = function(){ // code )};

< element ondrop="code">

// no mobile browser support except ios safari
// when key pressed
doc-win-el.addEventListener('keydown', fn_name(e));

doc-win-el.onkeydown = function(){ // code )};

< element onkeydown="code">
// when key released
doc-win-el.addEventListener('keyup', fn_name(e));

doc-win-el.onkeyup = function(){ // code )};

< element onkeyup="code">
// when an element captures a pointer using setPointerCapture()
doc-win-el.addEventListener('gotpointercapture', fn_name(e));

doc-win-el.ongotpointercapture = function(){ // code )};

< element ongotpointercapture="code">
// when a captured pointer is released
doc-win-el.addEventListener('lostpointercapture', fn_name(e));

doc-win-el.onlostpointercapture = function(){ // code )};

< element onlostpointercapture="code">
// when a pointer event is canceled
doc-win-el.addEventListener('pointercancel', fn_name(e));

doc-win-el.onpointercancel = function(){ // code )};

< element onpointercancel="code">
// when cliked down
doc-win-el.addEventListener('pointerdown', fn_name(e));

doc-win-el.onpointerdown = function(){ // code )};

< element onpointerdown="code">
// when clik released
doc-win-el.addEventListener('pointerup', fn_name(e));

doc-win-el.onpointerup = function(){ // code )};

< element onpointerup="code">
// when a pointer is moved into
doc-win-el.addEventListener('pointerenter', fn_name(e));

doc-win-el.onpointerenter = function(){ // code )};

< element onpointerenter="code">
// when a pointer is moved out
doc-win-el.addEventListener('pointerleave', fn_name(e));

doc-win-el.onpointerleave = function(){ // code )};

< element onpointerleave="code">
// when a pointer changes coordinates
doc-win-el.addEventListener('pointermove', fn_name(e));

doc-win-el.onpointermove = function(){ // code )};

< element onpointermove="code">
// when a pointer is moved out
doc-win-el.addEventListener('pointerout', fn_name(e));

doc-win-el.onpointerout = function(){ // code )};

< element onpointerout="code">
// when a pointer is moved into
doc-win-el.addEventListener('pointerover', fn_name(e));

doc-win-el.onpointerover = function(){ // code )};

< element onpointerover="code">
//  when one or more touch points have been disrupted / too many touch points are created
doc-win-el.addEventListener('touchcancel', fn_name(e));

doc-win-el.ontouchcancel = function(){ // code )};

< element ontouchcancel="code">
// when one or more touch points are removed
doc-win-el.addEventListener('touchend', fn_name(e));

doc-win-el.ontouchend = function(){ // code )};

< element ontouchend="code">
// when one or more touch points are moved
doc-win-el.addEventListener('touchmove', fn_name(e));

doc-win-el.ontouchmove = function(){ // code )};

< element ontouchmove="code">
// when one or more touch points are placed
doc-win-el.addEventListener('touchstart', fn_name(e));

doc-win-el.ontouchstart = function(){ // code )};

< element ontouchstart="code">
// when focus out
doc-win-el.addEventListener('blur', fn_name(e));

doc-win-el.onblur = function(){ // code )};

< element onblur="code">
// when focus in
doc-win-el.addEventListener('focus', fn_name(e));

doc-win-el.onfocus = function(){ // code )};

< element onfocus="code">
// when clicked
doc-win-el.addEventListener('click', fn_name(e));

doc-win-el.onclick = function(){ // code )};

< element onclick="code">
// when double clicked
doc-win-el.addEventListener('dblclick', fn_name(e));

doc-win-el.ondblclick = function(){ // code )};

< element ondblclick="code">
// when the value change
doc-win-el.addEventListener('change', fn_name(e));

doc-win-el.onchange = function(){ // code )};

< element onchange="code">
// input events on the < input>, < select>, < textarea> and contenteditable or designMode
doc-win-el.addEventListener('input', fn_name(e));

doc-win-el.oninput = function(){ // code )};

< element oninput="code">
// when a non-primary button pressed (a middle mouse button)
doc-win-el.addEventListener('auxclick', fn_name(e));

doc-win-el.onauxclick = function(){ // code )};

< element onauxclick="code">
// when the right mouse button is clicked on the window
doc-win-el.addEventListener('contextmenu', fn_name(e));

doc-win-el.oncontextmenu = function(){ // code )};

< element oncontextmenu="code">
// when depresses the mouse button
doc-win-el.addEventListener('mousedown', fn_name(e));

doc-win-el.onmousedown = function(){ // code )};

< element onmousedown="code">
// once when hover in
doc-win-el.addEventListener('mouseenter', fn_name(e));

doc-win-el.onmouseenter = function(){ // code )};

< element onmouseenter="code">
// once when hover out
doc-win-el.addEventListener('mouseleave', fn_name(e));

doc-win-el.onmouseleave = function(){ // code )};

< element onmouseleave="code">
// continuously when hover
doc-win-el.addEventListener('mousemove', fn_name(e));

doc-win-el.onmousemove = function(){ // code )};

< element onmousemove="code">
// when hover out even the child
doc-win-el.addEventListener('mouseout', fn_name(e));

doc-win-el.onmouseout = function(){ // code )};

< element onmouseout="code">
// once when hover even the child
doc-win-el.addEventListener('mouseover', fn_name(e));

doc-win-el.onmouseover = function(){ // code )};

< element onmouseover="code">
// when releases the mouse button
doc-win-el.addEventListener('mouseup', fn_name(e));

doc-win-el.onmouseup = function(){ // code )};

< element onmouseup="code">
// after text inside an < input type="text"> or < textarea> is selected
doc-win-el.addEventListener('select', fn_name(e));

doc-win-el.onselect = function(){ // code )};

< element onselect="code">
// when the selection begins
doc-win-el.addEventListener('selectstart', fn_name(e));

doc-win-el.onselectstart = function(){ // code )};

< element onselectstart="code">
// when the current text selection on a document is changed
doc-win-el.addEventListener('selectionchange', fn_name(e));

doc-win-el.onselectionchange = function(){ // code )};

< element onselectionchange="code">
// when the user clicks a reset button in a form (< input type="reset">)
doc-win-el.addEventListener('reset', fn_name(e));

doc-win-el.onreset = function(){ // code )};

< element onreset="code">
// when a submittable element has been checked and doesn't satisfy its constraints
doc-win-el.addEventListener('invalid', fn_name(e));

doc-win-el.oninvalid = function(){ // code )};

< element oninvalid="code">
//  when the user submits a form
doc-win-el.addEventListener('submit', fn_name(e));

doc-win-el.onsubmit = function(){ // code )};

< element onsubmit="code">
// When a JavaScript runtime error/When a resource(img,script) fails to load
doc-win-el.addEventListener('error', fn_name(e));

doc-win-el.onerror = function(){ // code )};

< element onerror="code">
// when dismissing
doc-win-el.addEventListener('cancel', fn_name(e));

doc-win-el.oncancel = function(){ // code )};

< element oncancel="code">
// when media playback has been paused
doc-win-el.addEventListener('pause', fn_name(e));

doc-win-el.onpause = function(){ // code )};

< element onpause="code">
// when media playback has been played
doc-win-el.addEventListener('play', fn_name(e));

doc-win-el.onplay = function(){ // code )};

< element onplay="code">
// when playback is ready to start after having been paused or delayed due to lack of media data.
doc-win-el.addEventListener('playing', fn_name(e));

doc-win-el.onplaying = function(){ // code )};

< element onplaying="code">
// after the window has been resized
doc-win-el.addEventListener('resize', fn_name(e));

doc-win-el.onresize = function(){ // code )};

< element onresize="code">
// when a seek completed/playback position changed/seeking attribute is changed to false
doc-win-el.addEventListener('seeked', fn_name(e));

doc-win-el.onseeked = function(){ // code )};

< element onseeked="code">
// when a seek starts - seeking attribute has changed to true and the media is seeking a new position
doc-win-el.addEventListener('seeking', fn_name(e));

doc-win-el.onseeking = function(){ // code )};

< element onseeking="code">
//  when the playback rate has changed
doc-win-el.addEventListener('ratechanged', fn_name(e));

doc-win-el.onratechanged = function(){ // code )};

< element onratechanged="code">
// when the volume has changed
doc-win-el.addEventListener('volumechange', fn_name(e));

doc-win-el.onvolumechange = function(){ // code )};

< element onvolumechange="code">
// when playback has stopped because the end of the media was reached
doc-win-el.addEventListener('ended', fn_name(e));

doc-win-el.onended = function(){ // code )};

< element onended="code">
// when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming
doc-win-el.addEventListener('stalled', fn_name(e));

doc-win-el.onstalled = function(){ // code )};

< element onstalled="code">
// when media data loading has been suspended
doc-win-el.addEventListener('suspend', fn_name(e));

doc-win-el.onsuspend = function(){ // code )};

< element onsuspend="code">
// when playback has stopped because of a temporary lack of data
doc-win-el.addEventListener('waiting', fn_name(e));

doc-win-el.onwaiting = function(){ // code )};

< element onwaiting="code">
// when the browser has started to load a resource
doc-win-el.addEventListener('loadstart', fn_name(e));

doc-win-el.onloadstart = function(){ // code )};

< element onloadstart="code">
// when the duration attribute has been updated
doc-win-el.addEventListener('durationchange', fn_name(e));

doc-win-el.ondurationchange = function(){ // code )};

< element ondurationchange="code">
// when the metadata has been loaded
doc-win-el.addEventListener('loadedmetadata', fn_name(e));

doc-win-el.onloadedmetadata = function(){ // code )};

< element onloadedmetadata="code">
// when the first frame of the media has finished loading
doc-win-el.addEventListener('loadeddata', fn_name(e));

doc-win-el.onloadeddata = function(){ // code )};

< element onloadeddata="code">
// when a request receives more data
doc-win-el.addEventListener('progress', fn_name(e));

doc-win-el.onprogress = function(){ // code )};

< element onprogress="code">
// when the user agent can play the media but estimates that not enough data has been loaded to play the media  
doc-win-el.addEventListener('canplay', fn_name(e));

doc-win-el.oncanplay = function(){ // code )};

< element oncanplay="code">
// when the user agent can play the media and estimates that enough data has been loaded to play the media
doc-win-el.addEventListener('canplaythrough', fn_name(e));

doc-win-el.oncanplaythrough = function(){ // code )};

< element oncanplaythrough="code">
// when the time indicated by the currentTime attribute has been updated
doc-win-el.addEventListener('timeupdate', fn_name(e));

doc-win-el.ontimeupdate = function(){ // code )};

< element ontimeupdate="code">
// when the media has become empty
// when the media has already been loaded
doc-win-el.addEventListener('emptied', fn_name(e));

doc-win-el.onemptied = function(){ // code )};

< element onemptied="code">
Node
baseURI
baseURI
// returns the absolute base URL of a Node
var x = document.body.baseURI;
// www.fallinfo.com

// read only 
                    
isConnected
isConnected
// returns a boolean indicating whether the node is connected to the context object
var x = document.body.isConnected;
// true

// read only 
                    
childNodes
childNodes
// returns a live NodeList of child nodes
var x = document.body.childNodes;
// NodeList(11) [text, div.header, div#cs, script, text, script, text, comment]

// read only 
                    
firstChild
firstChild
// returns the node's first child in the tree
var x = document.body.firstChild;
// #text

// read only 
                    
lastChild
lastChild
// returns the node's last child in the tree
var x = document.body.lastChild;
// #text

// read only 
                    
nextSibling
nextSibling
// returns the node immediately following the specified one in their parent's childNodes
var x = document.body.nextSibling;
// null

// read only 
                    
previousSibling
previousSibling
// returns the node immediately preceding the specified one in their parent's childNodes
var x = document.body.previousSibling;
// null

// read only 
                    
nodeName
nodeName
// returns the name of the current Node as a string
var x = document.body.nodeName;
// "BODY"

// read only 



// Attr
// The value of Attr.name

// CDATASection
// "#cdata-section"

// Comment
// "#comment"

// Document
// "#document"

// DocumentFragment
// "#document-fragment"

// DocumentType
// The value of DocumentType.name

// Element
// The value of Element.tagName

// Entity
// The entity name

// EntityReference
// The name of entity reference

// Notation
// The notation name

// ProcessingInstruction
// The value of ProcessingInstruction.target

// Text
// "#text"

                    
nodeType
nodeType
// Integer that identifies what the node is
var x = document.body.nodeType;
// 1

// read only 



// Node.ELEMENT_NODE	1	
// An Element node

// Node.TEXT_NODE	3	
// The actual Text inside an Element or Attr

// Node.CDATA_SECTION_NODE	4	
// A CDATASection, such as 

// Node.PROCESSING_INSTRUCTION_NODE	7	
// A ProcessingInstruction of an XML document

// Node.COMMENT_NODE	8	
// A Comment node

// Node.DOCUMENT_NODE	9	
// A Document node

// Node.DOCUMENT_TYPE_NODE	10	
// A DocumentType node, such as < !DOCTYPE html>

// Node.DOCUMENT_FRAGMENT_NODE	11	
// A DocumentFragment node
                    
nodeValue
nodeValue
// returns or sets the value of the current node
var x = document.body.nodeValue;
// null



// CDATASection
// Content of the CDATA section

// Comment
// Content of the comment

// Document
// null

// DocumentFragment
// null

// DocumentType
// null

// Element
// null

// NamedNodeMap
// null

// EntityReference
// null

// Notation
// null

// ProcessingInstruction
// Entire content excluding the target

// Text
// Content of the text node

                    
ownerDocument
ownerDocument
// returns the top-level document object of the node
var x = document.body.ownerDocument;
// #document

// read only 
                    
parentNode
parentNode
// returns the parent of the specified node in the DOM tree
var x = document.body.parentNode;
// #html

// read only 
                    
parentElement
parentElement
// returns the DOM node's parent Element, or null
var x = document.body.parentElement;
// #html

// read only 
                    
textContent
textContent
// represents the text content of the node and its descendants
var x = document.body.textContent;
// all the child text

// read only 
                    
childElementCount
childElementCount
// returns an unsigned long representing the number of child elements of the given element

var x = document.getElementById('id_name');
if (x.childElementCount > 0) {
  // code
}

// read only

// no safari support
            
children
children
// returns a live HTMLCollection which contains all of the child elements of the node

var x = document.getElementById('id_name');
for (let i = 0; i < x.children.length; i++) {
  // code
}

// read only
            
firstElementChild
firstElementChild
// Returns the first node which is both a child of this ParentNode and is also an Element

var x = document.getElementById('id_name');
var y = x.firstElementChild;
// node

// read only
            
lastElementChild
lastElementChild
// Returns the last node which is both a child of this ParentNode and is an Element

var x = document.getElementById('id_name');
var y = x.lastElementChild;
// node

// read only
            
querySelector()
querySelector()
// Get first element by class
var x = document.body.querySelector('.class_name');

// Get first element by id
var x = document.body.querySelector('#id_name');

// Get first div element
var x = document.body.querySelector('div');

// Other examples
var x = document.body.querySelector("div.class_name_1.class_name_1");
var x = document.body.querySelector("div.class_name_1 .class_name_1");
var x = document.body.querySelector("div.class_name > p");
var x = document.body.querySelector("div.class_name_1.class_name_2 input[attr='val']");
var x = document.body.querySelector("div.class_name_1:not(.class_name_2) input[attr='val']");
                
querySelectorAll()
querySelectorAll()
// Get first element by class
var x = document.body.querySelectorAll('.class_name');

// Get first element by id
var x = document.body.querySelectorAll('#id_name');

// Get first div element
var x = document.body.querySelectorAll('div');

// Other examples
var x = document.body.querySelectorAll("div.class_name > p");
var x = document.body.querySelectorAll("div.class_name, div.class_name");
var x = document.body.querySelectorAll("div.class_name > p");
var x = document.body.querySelectorAll("iframe[data-src]");
var x = document.body.querySelectorAll("li[data-active='1']");

                
append()
append()
// inserts a set of Node objects or DOMString objects after the last child of the ParentNode
var x = document.createElement("span");
document.body.append(x);
                
prepend()
prepend()
// inserts a set of Node objects or DOMString objects before the first child of the ParentNode
var x = document.createElement("span");
document.body.prepend(x);
                
replaceChildren()
replaceChildren()
// replaces the existing children of a Node with a specified new set of children
document.body.replaceChildren(old_el,new_el);
                
replaceWith()
replaceWith()
// Replaces this ChildNode in the children list of 
// its parent with a set of Node or DOMString objects

var x = document.createElement("span");

document.body.replaceWith(span);
                
remove()
remove()
// removes the object from the tree it belongs to
// remove all child nodes
var x = document.getElementById('id_name');
x.remove();
                
before()
before()
// inserts a set of Node or DOMString objects in the children list 
// of this ChildNode's parent, just before this ChildNode

var x = document.createElement("span");

document.body.before(x);

document.body.before("some text");

document.body.before(x,"some text");
                
after()
after()
// inserts a set of Node or DOMString objects in the children list 
// of this ChildNode's parent, just after this ChildNode

var x = document.createElement("span");

document.body.after(x);

document.body.after("some text");

document.body.after(x,"some text");

                
appendChild()
appendChild()
// adds a node to the end specified parent node
var x = document.createElement("span");

document.body.appendChild(x);
                    
removeChild()
removeChild()
// removes a child node from the DOM
// returns the removed node
var x = document.body;

var y = document.body.removeChild(x);
document.body.removeChild(x);

// 
                    
replaceChild()
replaceChild()
// replaces a child node within the given node
var x = document.getElementById('id_name_one');
var y = document.getElementById('id_name_two');

document.body.replaceChild(x,y);


// replaceChild(new,old);
                    
insertBefore()
insertBefore()
// inserts a node before a reference node as a child of a specified parent node
var x = document.createElement("span");

document.body.insertBefore(x,document.body.firstChild);

                    
contains()
contains()
// returns a Boolean value indicating whether a node is a descendant of a given node
var x = document.body;
var y = document.contains(x)
// true
                    
hasChildNodes()
hasChildNodes()
// returns a Boolean value indicating whether the given Node has child nodes
var x = document.body.hasChildNodes();
// true
                    
isEqualNode()
isEqualNode()
// tests whether two nodes are equal
var x = document.getElementById("id_name_one");
var y = document.getElementsById("id_name_two");

var z = y.isEqualNode(x);
// true
                    
isSameNode()
isSameNode()
// tests whether two nodes are the same 
// whether they reference the same object
var x = document.getElementById("id_name_one");
var y = document.getElementsById("id_name_two");

var z = y.isSameNode(x);
// true
                    
cloneNode()
cloneNode()
// returns a duplicate of the node on which this method was called
var x = document.getElementById("id_name");
var y = x.cloneNode(true);

// If true, then node and its whole subtree copied
                    
compareDocumentPosition()
compareDocumentPosition()
// reports the position of the given node relative to another node in any document
var x = document.head;
var y = document.body;

var z = head.compareDocumentPosition(body);

DOCUMENT_POSITION_DISCONNECTED	1
DOCUMENT_POSITION_PRECEDING	2
DOCUMENT_POSITION_FOLLOWING	4
DOCUMENT_POSITION_CONTAINS	8
DOCUMENT_POSITION_CONTAINED_BY	16
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC	32

                    
getRootNode()
getRootNode()
// Returns the context object's root which optionally includes the shadow root if it is available
var x = document.body.getRootNode();
// #document
                    
normalize()
normalize()
// Clean up all the text nodes under this element
// removes empty Text nodes, and joins adjacent Text nodes
document.body.normalize();
                    
Function
function
function
function fn_name(parameters) {
  // Code
}


// SELF INOVOKING
(function () {
  // Code
})();


// ARROW FUNCTION
fn_name = () => { 
  // Code
};
                
call
call
var obj1 = {
  TEST: function(a, b) {
    return a + b + this.xxx + this.yyy;
  }
}
var obj2 = {
  xxx: "xxx",
  yyy: "yyy"
}
obj1.TEST.call(obj2, "aaa", "bbb");


// A method that can be used on different objects
                
apply
apply
var obj1 = {
  TEST: function(a, b) {
    return a + b + this.xxx + this.yyy;
  }
}
var obj2 = {
  xxx: "xxx",
  yyy: "yyy"
}
obj1.TEST.apply(obj2, ["aaa", "bbb"]);


// a method that can be used on different objects
                
Promises
Promise
Promise
// Type 1 - Basic
let done = true;

new Promise((resolve, reject) => {
  if (done) {
    resolve("Job done");
  } else {
    reject("Still working");
  }
}).then((val) => {
    console.log(val);
  })
  .catch((val) => {
    console.log(val);
  });


// Type 2
let done = true;

const isJobDone = new Promise((resolve, reject) => {
  if (done) {
    resolve("Job done");
  } else {
    reject("Still working");
  }
});

isJobDone
  .then((val) => {
    console.log(val);
  })
  .catch((val) => {
    console.log(val);
  });


// Type 3
let done = true;

const isJobDone = new Promise((resolve, reject) => {
  if (done) {
    resolve("Job done");
  } else {
    reject("Still working");
  }
});

const check = function () {
  isJobDone
    .then((val) => {
      console.log(val);
    })
    .catch((val) => {
      console.log(val);
    });
};

check();


// Type 4 - Chaining 1
let done = true;

new Promise(function (resolve, reject) {
  if (done) {
    resolve("Job done");
  } else {
    reject("Still working");
  }
})
  .then(function (val) {
      return val + " - Verified";
  })
  .then(function (val) {
    console.log(val);
  })
  .catch((val) => {
    console.log(val);
  });


// Type 5 - Chaining 2
const check1 = function (response) {
  if (response == "Job done") {
    return Promise.resolve(response + "- verified");
    (or)
    return response + "- verified";
  } else {
    return Promise.reject("Verification failed");
    (or)
    return "Verification failed"
  }
};

const check2 = function (response) {
  console.log(response);
};

let done = true;

new Promise(function (resolve, reject) {
  if (done) {
    resolve("Job done");
  } else {
    reject("Still working");
  }
})
  .then(check1)
  .then(check2)
  .catch((val) => {
    console.log(val);
  });
                
Async / Await
Async / Await
// async function will wait at await
// until resolve or reject

var done = true;
const isJobDone = function () {
  return new Promise(function (resolve, reject) {
    setTimeout(function () {
      if (done) {
        resolve("Job  1 done");
      } else {
        reject("Still working 1");
      }
    }, 2000);
  });
};

const check = async function () {
  try {
    var val = await isJobDone();
    // Rest of the code after resolved
    console.log(val);
  } catch (val) {
    console.log(val);
  }
};

check();



// Async / Await Channing 1
var done1 = true;
var done2 = true;
const isJobDone1 = function () {
  return new Promise(function (resolve, reject) {
    setTimeout(function () {
      if (done1) {
        resolve("Job 1 done");
      } else {
        reject("Still working 1");
      }
    }, 2000);
  });
};
const isJobDone2 = function () {
  return new Promise(function (resolve, reject) {
    setTimeout(function () {
      if (done2) {
        resolve("Job 2 done");
      } else {
        reject("Still working 2");
      }
    }, 2000);
  });
};
const check = async function () {
  try {
    var val1 = await isJobDone1();
    console.log(val1);
    var val2 = await isJobDone2();
    console.log(val2);
  } catch (val) {
    console.log(val);
  }
};

check();


// Async / Await Channing 2
const isJobDone3 = function () {
  return new Promise(function (resolve) {
    setTimeout(function () {
      resolve("Job 3");
    }, 2000);
  });
};

const isJobDone2 = async function () {
  const val = await isJobDone3();
  return "Job 2 and " + val;
};

const isJobDone1 = async function () {
  const val = await isJobDone2();
  return "Job 1, " + val + " are done";
};

isJobDone1().then((res) => {
  console.log(res);
});
                
all / race
all / race
// all - Resolve multiple promises
// all - If all resolve , returns array
// all - if any one reject, return reject only for that one

// race - Returns the first resolved

var done1 = true;
var done2 = true;

const isJobDone1 = new Promise((resolve, reject) => {
  if (done1) {
    resolve("Job  1 done");
  } else {
    reject("Still working 1");
  }
});

const isJobDone2 = new Promise((resolve, reject) => {
  setTimeout(function () {
    if (done2) {
      resolve("Job  2 done");
    } else {
      reject("Still working 2");
    }
  }, 2000);
});

Promise.all([isJobDone1, isJobDone2])
  .then((val) => {
    console.log(val);
  })
  .catch((val) => {
    console.log(val);
  });

  (or)

  Promise.race([isJobDone1, isJobDone2])
  .then((val) => {
    console.log(val);
  })
  .catch((val) => {
    console.log(val);
  });
                
Regular Expression
Modifiers
Modifiers
*************************************************************

g
- Perform a global match 
- find all matches rather than stopping after the first match

var str = "Fallinfo Fallinfo";
var patt = /[A-Z]/g;
var x = str.match(patt);

OUTPUT - F,F

*************************************************************

i	
- Perform case-insensitive matching

var str = "Fallinfo";
var patt = /[A-Z]/gi;
var x = str.match(patt);

OUTPUT - F,a,l,l,i,n,f,o

*************************************************************

m	
- Perform multiline matching

var str = "Fallinfo \n Fallinfo";
var patt = /[A-Z]/gm;
var x = str.match(patt);

OUTPUT - F,F

*************************************************************
                
Brackets
Brackets
*************************************************************

[abc]	
- Find any character between the brackets

var str = "Fallinfo";
var patt = /[fi]/g; 
var str = x.match(patt);

OUTPUT - i,f

[abcde..] - Any character between the brackets
[A-Z] - Any character from uppercase A to uppercase Z
[a-z] - Any character from lowercase a to lowercase z
[A-z ]- Any character from uppercase A to lowercase z

*************************************************************

[^abc]	
Find any character NOT between the brackets

var str = "Fallinfo";
var patt = /[^F]/g;
var x = str.match(patt);

OUTPUT - a,l,l,i,n,f,o

[abcde..] - Any character between the brackets
[A-Z] - Any character from uppercase A to uppercase Z
[a-z] - Any character from lowercase a to lowercase z
[A-z ]- Any character from uppercase A to lowercase z

*************************************************************

[0-9]	
- Find any character between the brackets (any digit)

var str = "123456789";
var patt = /[1-4]/g;
var x = str.match(patt);

OUTPUT - 1,2,3,4

*************************************************************

[^0-9]	
- Find any character NOT between the brackets (any non-digit)

var str = "123456789";
var patt = /[^1-4]/g;
var x = str.match(patt);

OUTPUT - 5,6,7,8,9

*************************************************************

(x|y)	
- Find any of the alternatives specified

var str = "Fallinfo 123";
var patt = /(fo|i|2)/g;
var x = str.match(patt);

OUTPUT - i,fo,2

*************************************************************
                
Metacharacters
Metacharacters
*************************************************************

.
- Find a single character, except newline or line terminator

var str = "That's hot!";
var patt = /h.t/g;
var x = str.match(patt);

OUTPUT - hat,hot

*************************************************************

\w
- Find a word character
- A word character is from a-z, A-Z, 0-9, and _

var str = "Give 100%!"; 
var patt = /\w/g;
var x = str.match(patt);

OUTPUT - G,i,v,e,1,0,0

*************************************************************

\W
- Find a non-word character

- A non-word character is other than a-z, A-Z, 0-9, and _

var str = "Give 100%!";
var patt = /\W/g;
var x = str.match(patt);

OUTPUT - ,%,!

*************************************************************

\d
- Find a digit
- digit from 0-9.

var str = "Give 100%!"; 
var patt = /\d/g;
var x = str.match(patt);

OUTPUT - 1,0,0

*************************************************************

\D
- Find a non-digit character

var str = "Give 100%!"; 
var patt = /\D/g;
var x = str.match(patt);

OUTPUT - G,i,v,e, ,%,!

*************************************************************

\s
- Find a whitespace character
- A space character
- A tab character
- A carriage return character
- A new line character
- A vertical tab character
- A form feed character


var str = "Is this all there is?";
var patt = /\s/g;
var x = str.match(patt);

OUTPUT - , , ,


*************************************************************

\S
- Find a non-whitespace character
- A space character
- A tab character
- A carriage return character
- A new line character
- A vertical tab character
- A form feed character

var str = "Is this all there is?";
var patt = /\S/g;
var x = str.match(patt);

OUTPUT - I,s,t,h,i,s,a,l,l,t,h,e,r,e,i,s,?

*************************************************************

\b
- Find a match at the beginning/end of a word
- beginning like this: \bLO
- end like this: LO\b
- If no match is found, it returns null

var str = "HELLO, LOOK AT YOU!"; 
var patt = /\bLO/;
var x = str.search(patt);

OUTPUT - 7

var str = "HELLO, LOOK AT YOU!"; 
var patt = /LO\b/;
var x = str.search(patt);

OUTPUT - 3

*************************************************************

\B
- Find a match, but not at the beginning/end of a word

var str = "HELLO, LOOK AT YOU!"; 
var patt = /\BLO/;
var x = str.search(patt);

OUTPUT - 3

var str = "HELLO, LOOK AT YOU!"; 
var patt = /LO\B/;
var x = str.search(patt);

OUTPUT - 7


*************************************************************

\0
- Find a NULL character
- if no NULL, it returns -1

var str = "Fallinfo \0"; 
var patt = /\0/;
var x = str.search(patt);

OUTPUT - 9


*************************************************************

\n
- Find a new line character

var str = "Fallinfo \n Fallinfo"; 
var patt = /\n/;
var x = str.search(patt);

OUTPUT - 9

*************************************************************

\f
- Find a form feed character

var str = "Fallinfo \f Fallinfo"; 
var patt = /\f/;
var x = str.search(patt);

OUTPUT - 9

*************************************************************

\r
- Find a carriage return character

var str = "Fallinfo \r Fallinfo"; 
var patt = /\r/;
var x = str.search(patt);

OUTPUT - 9

*************************************************************

\t
- Find a tab character

var str = "Fallinfo \t Fallinfo"; 
var patt = /\t/;
var x = str.search(patt);

OUTPUT - 9

*************************************************************

\v
- Find a vertical tab character

var str = "Fallinfo \v Fallinfo"; 
var patt = /\v/;
var x = str.search(patt);

OUTPUT - 9

*************************************************************

\xxx
- Find the character specified by an octal number OUTPUT

var str = "Fallinfow"; 
var patt = /\106/g;
var x = str.match(patt);

OUTPUT - F

*************************************************************

\xdd
- Find the character specified by a hexadecimal number dd

var str = "Fallinfo"; 
var patt = /\x46/g;
var x = str.match(patt);

OUTPUT - F

*************************************************************

\udddd
- Find the Unicode character specified by a hexadecimal number dddd

var str = "Fallinfo"; 
var patt = /\u0046/g;
var x = str.match(patt);

OUTPUT - F

*************************************************************

                
Quantifiers
Quantifiers
*************************************************************

n+
- Matches any string that contains at least one n

var str = "Fallinfo Fallinfo"; 
var patt = /o+/g;
var x = str.match(patt);

OUTPUT - o,o

var str = "Fallinfo Fallinfo"; 
var patt = /\w+/g;
var x = str.match(patt);

OUTPUT - Fallinfo,Fallinfo
*************************************************************

n*
- Matches any string that contains zero or more occurrences of n
- must have first character
- may have second character
- may have two or more second character

var str = "Fallinfo"; 
var patt = /li*/g;
var x = str.match(patt);

OUTPUT - l,li

*************************************************************

n?
- Matches any string that contains zero or one occurrences of n
- must have first character
- may have second character
- cannot have two or more second character

var str = "1, 100 or 1000?";
var patt = /10?/g;
var x = str.match(patt);

OUTPUT - 1,10,10

*************************************************************

n{X}
- Matches any string that contains a sequence of X n's

var str = "100, 1000, 10000, 100000";
var patt = /\d{4}/g;
var x = str.match(patt);

OUTPUT - 1000,1000,1000

*************************************************************

n{X,Y}
- Matches any string that contains a sequence of X to Y n's

var str = "100, 1000, 10000, 100000";
var patt = /\d{3,4}/g; 
var x = str.match(patt);

OUTPUT - 100,1000,1000,1000

*************************************************************

n{X,}
- Matches any string that contains a sequence of at least X n's

var str = "100, 1000, 10000, 100000";
var patt = /\d{3,}/g; 
var x = str.match(patt);

OUTPUT - 100,1000,10000,100000

*************************************************************

n$
- Matches any string with n at the end of it
- If not found, it returns -1

var str = "Fallinfo";
var patt = /fo$/g;
var x = str.search(patt);

OUTPUT - 6

*************************************************************

^n
- Matches any string with n at the beginning of it
- If not found, it returns -1

var str = "Fallinfo";
var patt = /^Fa/g;
var x = str.search(patt);

OUTPUT - 0

*************************************************************

?=n
- Matches any string that is followed by a specific string n
- If not found, it returns -1

var str = "Fallinfo Fallinfo";
var patt = /fo(?= Fa)/g;
var x = str.search(patt);

OUTPUT - 6

*************************************************************

?!n
- Matches any string that is not followed by a specific string n

var str = "Fallinfo Fallinfo";
var patt = /fo(?! Fa)/g;
var x = str.search(patt);

OUTPUT - 15

*************************************************************

                
global
global
// Checks whether the "g" modifier is set

var str = "Fallinfo";
var patt = /[A-Z]/g;
var x = patt.global;
// true
                
ignoreCase
ignoreCase
// Checks whether the "i" modifier is set

var str = "Fallinfo";
var patt = /[A-Z]/i;
var x = patt.global;
// true
                
lastIndex
lastIndex
// Specifies the index at which to start the next match
// returns positions where match found and matching start
// only works if the "g" modifier is set
// by exec( ) or test( ) methods
// exec( ) and test( ) reset lastIndex to 0 if they do not get a match

var str = "Fallinfo Fallinfo Fallinfo";
var patt = /in/g;

while (patt.test(str) == true)  {
  console.log(patt.lastIndex);
}

// 6
// 15
// 24
                
multiline
multiline
// 	Checks whether the "m" modifier is set

var str = "Fallinfo";
var patt = /[A-Z]/m;
var x = patt.global;
// true
                
source
source
// 	Returns the text of the RegExp pattern

var str = "Fallinfo";
var patt = /[A-Z]/g;
var x = patt.source;
// [A-Z]
                
patt.exec()
patt.exec()
// Tests for a match in a string. Returns the first match

var str = "Fallinfo";
var patt = /[A-Z]/g;
var x = patt.exec(str);
// F
                
patt.test()
patt.test()
// Tests for a match in a string. Returns true or false

var str = "Fallinfo";
var patt = /[A-Z]/g;
var x = patt.test(str);
// true
                
patt.toString()
patt.toString()
// Returns the string value of the regular expression

var str = "Fallinfo";
var patt = /[A-Z]/g;
var res = patt.toString();
// /[A-Z]/g
                
Number
.isFinite()
.isFinite()
Number.isFinite(123) //true
Number.isFinite(-1.23) //true
Number.isFinite(5-2) //true
Number.isFinite(0) //true
Number.isFinite('123') //false
Number.isFinite('Hello') //false
Number.isFinite('2005/12/12') //false
Number.isFinite(Infinity) //false
Number.isFinite(-Infinity) //false
Number.isFinite(0 / 0) //false

// Determines whether a value is a finite number
                
.isInteger()
.isInteger()
Number.isInteger(123) //true
Number.isInteger(-123) //true
Number.isInteger(5-2) //true
Number.isInteger(0) //true
Number.isInteger(0.5) //false
Number.isInteger('123') //false
Number.isInteger(false) //false
Number.isInteger(Infinity) //false
Number.isInteger(-Infinity) //false
Number.isInteger(0 / 0) //false

// Determines whether a value an integer.
                
.isSafeInteger()
.isSafeInteger()
Number.isSafeInteger(123) //true
Number.isSafeInteger(-123) //true
Number.isSafeInteger(5-2) //true
Number.isSafeInteger(0) //true
Number.isSafeInteger(0.5) //false
Number.isSafeInteger(Math.pow(2, 53)) //false
Number.isSafeInteger(Math.pow(2, 53) - 1) //true
Number.isSafeInteger('123') //false
Number.isSafeInteger(false) //false
Number.isSafeInteger(Infinity) //false
Number.isSafeInteger(-Infinity) //false
Number.isSafeInteger(0 / 0) //false

// Determines whether a value an 
// IEEE-754 double precision number (all integers from (253 - 1) to -(253 - 1))
                
.isNaN()
.isNaN()
Number.isNaN(123) //false
Number.isNaN(-1.23) //false
Number.isNaN(5-2) //false
Number.isNaN(0) //false
Number.isNaN('123') //false
Number.isNaN('Hello') //false
Number.isNaN('2005/12/12') //false
Number.isNaN('') //false
Number.isNaN(true) //false
Number.isNaN(undefined) //false
Number.isNaN('NaN') //false
Number.isNaN(NaN) //true
Number.isNaN(0 / 0) //true

// Determines whether a value is NaN (Not-A-Number)
                
.NaN
.NaN
var x = Number.NaN
// Not a number
                
.MAX_VALUE
.MAX_VALUE
var x = Number.MAX_VALUE
// 1.7976931348623157e+308
                
.MIN_VALUE
.MIN_VALUE
var x = Number.MIN_VALUE
// 5e-324
                
.NEGATIVE_INFINITY
.NEGATIVE_INFINITY
var x = Number.NEGATIVE_INFINITY
// -Infinity
                
.POSITIVE_INFINITY
.POSITIVE_INFINITY
var x = Number.POSITIVE_INFINITY
// Infinity
                
num.toExponential()
num.toExponential()
Var num = 5.56789;
num.toExponential();
// 5.56789e+0

var num = 5.56789;
num.toExponential(1);
// 5.6e+0
                
num.toFixed()
num.toFixed()
Var num = 5.56789;
num.toFixed(2);
// 5.57

// converts to a specified number of decimals
                
num.toPrecision()
num.toPrecision()
Var num = 13.3714;
num.toPrecision(2);
// 13

// Formats a number to a specified length.
                
num.toLocaleString()
num.toLocaleString()
var x = 1000000;
x.toLocaleString("fi-FI");
// 1 000 000

// converts using a local language format
                
num.toString()
num.toString()
var num = 100;
num.toString();
// 100
                
num.valueOf()
num.valueOf()
var num = 100;
num.valueOf();
// 100
                
Math
.abs()
.abs()
Math.abs(-7.25)
// 7.25

// non-negative number
                
.trunc()
.trunc()
Math.trunc(8.76)
// 8

// Integer part
                
.sqrt()
.sqrt()
Math.sqrt(9)
// 3

// square root
                
.cbrt()
.cbrt()
Math.cbrt(125)
// 5

// cubic root
                
.ceil()
.ceil()
Math.ceil(1.4)
// 2

// rounded up
                
.floor()
.floor()
Math.floor(1.6)
// 1

// rounded down
                
.round()
.round()
Math.round(2.5)
// 3

// rounded up or down
                
.exp()
.exp()
Math.exp(1)
// 2.718281828459045

// Ex, where E is Euler's number
                
.log()
.log()
Math.log(2)
// 0.6931471805599453

// natural log
                
.max()
.max()
Math.max(5, 10)
// 10

// highest value
                
.min()
.min()
Math.min(5, 10)
// 5

// lowest value
                
.pow()
.pow()
Math.pow(4, 3)
// 64

// x to the power of y
// 43
                
.random()
.random()
Math.random()
// 0.24698129052142104

// between 0 >= and < 1 
                
.cos()
.cos()
Math.cos(3)
// -0.9899924966004454

// cosine
                
.cosh()
.cosh()
Math.cosh(3)
// 10.067661995777765

// hyperbolic cosine
                
.acos()
.acos()
Math.acos(0.5)
// 1.0471975511965979

// arccosine
                
.acosh()
.acosh()
Math.acosh(2)
// 1.3169578969248166

// hyperbolic arccosine
                
.sin()
.sin()
Math.sin(3)
// 0.1411200080598672

// sine
                
.sinh()
.sinh()
Math.sinh(3)
// 10.017874927409903

// hyperbolic sine
                
.asin()
.asin()
Math.asin(0.5)
// 0.5235987755982989

// arcsine
                
.asinh()
.asinh()
Math.asinh(1)
// 0.881373587019543

// hyperbolic arcsine
                
.tan()
.tan()
Math.tan(1)
// 1.5574077246549023

// tangent
                
.tanh()
.tanh()
Math.tanh(1)
// 0.7615941559557649

// hyperbolic tangent
                
.atan()
.atan()
Math.atan(2)
// 1.1071487177940904

// arctangent
                
.atanh()
.atanh()
Math.atanh(0.5)
// 0.5493061443340548

// hyperbolic arctangent
                
.atan2()
.atan2()
Math.atan2(8, 4)
// 1.1071487177940904

// arctangent of 8/4
                
.E
.E
Math.E
// 2.718281828459045

// Euler's number
                
.PI
.PI
Math.PI
// 3.141592653589793
                
.LN2
.LN2
Math.LN2
// 0.6931471805599453

// natural log of 2
                
.LN10
.LN10
Math.LN10
// 2.302585092994046

// natural log of 10
                
.LOG2E
.LOG2E
Math.LOG2E
// 1.4426950408889634

// base-2 log of E
                
.LOG10E
.LOG10E
Math.LOG10E
// 0.4342944819032518

// base-10 log of E
                
.SQRT1_2
.SQRT1_2
Math.SQRT1_2
// 0.7071067811865476

// sqrt of 1/2
                
.SQRT2
.SQRT2
Math.SQRT2
// 1.4142135623730951

// sqrt of 2
                
Error
err.name
err.name
try {
  xalert("fallinfo");
}
catch(err) {
  var x = err.name;
  // ReferenceError
}

// EvalError	An error in the eval(). Newer JS does not throw any EvalError.
// RangeError	A number "out of range"	
// ReferenceError	An illegal reference	
// SyntaxError	A syntax error	
// TypeError	A type error	
// URIError	An error in encodeURI()
                        
err.message
err.message
try {
  xalert("fallinfo");
}
catch(err) {
  var x = err.message;
  // xalert is not defined
}
                        
Document
documentElement
documentElement
var x = document.documentElement;
// returns html or root element
                
head
head
var x = document.head;
// returns head element
                
body
body
var x = document.body;
// returns body element
                
scrollingElement
scrollingElement
var x = document.scrollingElement;
// returns current scrolling element
                
doctype
doctype
var x = document.doctype;
// < !DOCTYPE html>

// read only
                
compatMode
compatMode
var x = document.compatMode;
// BackCompat - if the document is in quirks mode
// CSS1Compat - if the document is in no-quirk (standards)

// read only
                
implementation
implementation
var x = document.implementation;
// DOMImplementation {}

var x = document.implementation.hasFeature( 'HTML', '2.0' );
// true

// Check if DOM supported
// read only
                
characterSet
characterSet
var x = document.characterSet;
// "UTF-8"

// read only
                
contentType
contentType
var x = document.contentType;
// "text/html"

// read only
                
documentURI
documentURI
var x = document.documentURI;
// "https://www.fallinfo.com"

// read only
                
fonts
fonts
var x = document.fonts;
// returns FontFaceSet

var y = document.fonts.status;
// loaded

document.fonts.ready.then(function() {
  // Code
});

                
hidden
hidden
var x = document.hidden;
// false

// read only
                
visibilityState
visibilityState
var x = document.visibilityState;
// "visible"

// read only
                
title
title
var x = document.title;
// "fallinfo"

// read only
                
readyState
readyState
var x = document.readyState;
// "complete"
// Returns loading status of the document.

// read only
                
lastModified
lastModified
var x = document.lastModified;
// "10/14/2020 20:45:00"

// read only
                
timeline
timeline
var x = document.timeline;
// DocumentTimeline {currentTime: 1052012.961}

// read only
                
dir
dir
var x = document.dir;
// "rlt"

document.dir = "rtl";
document.dir = "ltr";

// text direction

                
designMode
designMode
var x = document.designMode;
// OFF - default

// Gets/sets the ability to edit the whole document.

                
childElementCount
childElementCount
var x = document.childElementCount;
// 1

// child count

                
children
children
// returns children elements
var x = document.children;

                
firstElementChild
firstElementChild
// returns first child element
var x = document.firstElementChild;

// safari - N
// IOS safari - N
// IE - N
                
lastElementChild
lastElementChild
// returns last child element
var x = document.lastElementChild;


// safari - N
// IOS safari - N
// IE - N
                
embeds
embeds
var x = document.embeds;
// returns all embedded elements
                
plugins
plugins
var x = document.plugins;
// returns all embedded elements
                
forms
forms
var x = document.forms;
// returns all form elements
                
images
images
var x = document.images;
// returns all images
                
links
links
var x = document.links;
// returns all links
                
scripts
scripts
var x = document.scripts;
// returns all script elements
                
URL
URL
var x = document.URL;
// "https://www.fallinfo.com"

// read only
                
referrer
referrer
var x = document.referrer;
// "https://www.fallinfo.com"
// previous reffered url

// read only
                
location
location
var x = document.location;
// Returns the URI of the current document.

// Object
                
cookie
cookie
var x = document.cookie;
// "some_cookie_data"

// setting cookie
document.cookie = "111=aaa";

// cookie with expiry
document.cookie = "111=aaa; expires=Thu, 18 Dec 2013 12:00:00 UTC";

// cookie with path specified
document.cookie = "111=aaa; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/";

// deleting cookie
document.cookie = "111=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";


// Example - Set cookie

var key = "111";
var value = "aaa";
var expiry_days = 10;
var date = new Date();

date.setTime(date.getTime() + (expiry_days*24*60*60*1000));
var expires = "expires="+ date.toUTCString();
document.cookie = key + "=" + value + ";" + expires + ";path=/";


// Example -  Get cookie

var name = "111=";
var decodedCookie = decodeURIComponent(document.cookie);
var splitted = decodedCookie.split(';');

for(var i = 0; i < splitted.length; i++) {
  var c = splitted[i];
  while (c.charAt(0) == ' ') {
    c = c.substring(1);
  }
  if (c.indexOf(name) == 0) {
    console.log(c.substring(name.length, c.length));
  }
}


// Example -  Check cookie

var key = getCookie("111");
if (key != "") {
 alert("cookie found");
} else {
  // set cookie
  }
}

                
defaultView
defaultView
var x = document.defaultView;
// returns window object

// Object
                
activeElement
activeElement
var x = document.activeElement;
var x = ShadowRoot.activeElement;

// return active element
                
fullscreenElement
fullscreenElement
var x = document.fullscreenElement;
var x = ShadowRoot.fullscreenElement;

// return fullscreen element
                
pointerLockElement
pointerLockElement
var x = document.pointerLockElement;
var x = ShadowRoot.pointerLockElement;

// return pointerLockElement element
                
styleSheets
styleSheets
var x = document.styleSheets;
var x = ShadowRoot.styleSheets;

// returns all styleSheet elements
// object
                
// when visibility changed
document.addEventListener('visibilitychange', fn_name(e));

document.onvisibilitychange = function(){ // code )};
                
// when all content loaded
document.addEventListener('DOMContentLoaded', fn_name(e));
                
// when the readyState attribute of a document has changed
document.addEventListener('readystatechange', fn_name(e));

document.onreadystatechange = function(){ // code )};
                
// when the pointer is locked/unlocked
document.addEventListener('pointerlockchange', fn_name(e));

document.onpointerlockchange = function(){ // code )};
                
// when locking the pointer failed
document.addEventListener('pointerlockerror', fn_name(e));

document.onpointerlockerror = function(){ // code )};
                
// when fullscreen changed
doc-el.addEventListener('fullscreenchange', fn_name(e));

doc-el.onfullscreenchange = function(){ // code )};
                
// when fullscreen error
doc-el.addEventListener('fullscreenerror', fn_name(e));

doc-el.onfullscreenerror = function(){ // code )};
                
adoptNode()
adoptNode()
// Adopt/Cut node from another document
var frame = document.getElementsByTagName("IFRAME")[0]
var h = frame.contentWindow.document.getElementsByTagName("H1")[0];
var x = document.importNode(h);
document.body.appendChild(x);
                
importNode()
importNode()
// Import/Copy node from another document

var frame = document.getElementsByTagName("IFRAME")[0]
var h = frame.contentWindow.document.getElementsByTagName("H1")[0];
var x = document.importNode(h, true);
document.body.appendChild(x);
                
createAttribute()
createAttribute()
var x = document.createAttribute('id');
x.value = 'id_name';
                
createComment()
createComment()
var x = document.createComment('some comment');
                
createElement()
createElement()
var x = document.createElement("span");
var x = document.createElement("div");
                
createDocumentFragment()
createDocumentFragment()
// Creates dummy fragment for DOM operations

var fragment = document.createDocumentFragment();
var text = document.createTextNode('AAA');
fragment.appendChild(text);

document.getElementById("id_name").appendChild(fragment);
                
createTextNode()
createTextNode()
var x = document.createTextNode("Some text");
                
createRange()
createRange()
// creating range of nodes
// selecting child nodes from start to end
var el = document.getElementById('test');

var range = document.createRange();
range.setStart(el, 0);
range.setEnd(el, 3);
                
exitPointerLock()
exitPointerLock()
// Release the pointer lock
var x = document.exitPointerLock();
                
hasStorageAccess()
hasStorageAccess()
// Storage API
document.hasStorageAccess().then(hasAccess => {
  if (hasAccess) {
    // storage access has been granted already.
  } else {
    // storage access hasn't been granted already;
    // should call requestStorageAccess().
  }
});
                
requestStorageAccess()
requestStorageAccess()
// Storage API
document.requestStorageAccess().then(
  () => { console.log('access granted') },
  () => { console.log('access denied') }
);
                
getElementById()
getElementById()
// Get element with id
var x = document.getElementById("id_name");
                
getElementsByClassName()
getElementsByClassName()
// Get all elements by class
var x = document.getElementsByClassName("class_name");

// Get first element by class
var x = document.getElementsByClassName('class_name')[0]

// Get all elements of both classes
var x = document.getElementsByClassName("class_name1 class_name2");

// Get all elements inside id by class
var x = document.getElementById('id_name').getElementsByClassName('class_name');

                
getElementsByTagName()
getElementsByTagName()
// Get all span elements
var x = document.getElementsByTagName('span');

// Get all div elements
var x = document.getElementsByTagName('div');

// Get all div elements inside the id
var x = document.getElementById('id_name');
var x = a.getElementsByTagName('div');
                
getElementsByName()
getElementsByName()
// Get elements using name attribut value
var x = document.getElementsByName("name_attr_val");
                
open()
open()
document.open(); 
// opens document for writing
                
write()
write()
document.write(); 
// writing in document
                
writeln()
writeln()
document.writeln(); 
// writing in document in new line
                
close()
close()
document.close(); 
// close document from writing
                
hasFocus()
hasFocus()
var x = document.hasFocus();
// true or false
                
getAnimations()
getAnimations()
var x = document.getElementById("some_id"); 
var y = x.getAnimations();

var x = document.getAnimations();
// returns an array of all Animation objects
                
                    
getSelection()
getSelection()
var x = document.getSelection();
// returns selected text object
                
elementFromPoint()
elementFromPoint()
// Get first element within the viewport coordinates
var x = document.elementFromPoint(horizontal X, vertical Y);
var x = document.elementFromPoint(10, 20);
                
elementsFromPoint()
elementsFromPoint()
// Get array of elements within the viewport coordinates
var x = document.elementsFromPoint(horizontal X, vertical Y);
var x = document.elementsFromPoint(10, 20);
                
XMLHttp
Example
Example
var x = new XMLHttpRequest();
x.onreadystatechange = function() {
  if (this.readyState == 4 && this.status == 200) {
    console.log(this.readyState);
    console.log(this.status);
    console.log(this.statusText);

    console.log(this.responseText);
    console.log(this.responseXML);

    console.log(this.getAllResponseHeaders());
    console.log(this.getResponseHeader('Last-Modified'));
  }
};
x.onload = function() {
  var data = JSON.parse(this.responseText);
  console.log(data);
}
x.onerror = function(err) {
  console.log('Fetch Error :', err);
}
x.open("GET", "API_URL", true);
x.setRequestHeader("Content-type", "application/json");
x.send();
x.abort();
                
// function to be called when the readyState property changes

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
  // code
};
x.open("GET", "API_URL", true);
x.send();
                
readyState
readyState
// Holds the status of the XMLHttpRequest

// 0: request not initialized
// 1: server connection established
// 2: request received
// 3: processing request
// 4: request finished and response is ready

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
  if (this.readyState == 4) {
    // code
  }
};
x.open("GET", "API_URL", true);
x.send();
                
status
status
// Returns the status-number of a request

// 200: "OK"
// 403: "Forbidden"
// 404: "Not Found"

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
  if (this.status == 200) {
    // code
  }
};
x.open("GET", "API_URL", true);
x.send();
                
statusText
statusText
// Returns the status-text 

// "OK" 
//  "Not Found"

// Returns the response data as XML data

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
  var y = this.statusText;
};
x.open("GET", "API_URL", true);
x.send();
                
responseText
responseText
// Returns the response data as a string

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
  var y = this.responseText;
};
x.open("GET", "API_URL.txt", true);
x.send();
                
responseXML
responseXML
// Returns the response data as XML data

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
  var y = this.responseXML;
};
x.open("GET", "API_URL.XML", true);
x.send();
                
XMLHttpRequest()
XMLHttpRequest()
// Creates a new XMLHttpRequest object

var x = new XMLHttpRequest();
                
open()
open()
// Specifies the request

var x = new XMLHttpRequest();
x.open("GET", "API_URL", true);

// open(method, url, async, user, psw)

// method: GET or POST
// url: the file location
// async: true (asynchronous) or false (synchronous)
// user: optional user name
// psw: optional password
                
send()
send()
// Sends the request to the server

var x = new XMLHttpRequest();
x.open("GET", "API_URL", true);
x.send();
x.send('SOME_TEXT_IF_POST');
                
setRequestHeader()
setRequestHeader()
// Adds a label/value pair to the header to be sent

var x = new XMLHttpRequest();
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                
abort()
abort()
// Cancels the current request

var x = new XMLHttpRequest();
x.abort();
                
getAllResponseHeaders()
getAllResponseHeaders()
// 	Returns header information

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
   var y = this.getAllResponseHeaders();
};
x.open("GET", "API_URL", true);
x.send();
                
getResponseHeader()
getResponseHeader()
// 	Returns specific header information

var x = new XMLHttpRequest();
x.onreadystatechange = function() {
   var y = this.getResponseHeader('Content-Type');
};
x.open("GET", "API_URL", true);
x.send();
                
Fetch
Example
Example
fetch(API_URL,{
  method: 'get/post',
  mode: 'cors',
  credentials: 'include',
  headers: {
    "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
  },
  body: obj
})
.then(
  function(response) {
    if (response.status !== 200) {
      console.log('Error - Status Code: ' + response.status);
      return;
    }

    // If success
    console.log(response.headers.get('Content-Type'));

    console.log(response.status);
    console.log(response.statusText);
    console.log(response.type);
    console.log(response.url);

    console.log(response.text());

    response.json().then(function(data) {
      console.log(data);
    });
  }
)
.catch(function(err) {
  console.log('Error : ', err);
});
                
Objects
Object
Object
var obj1 = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc",
  444 : function() {
      return this.111 + this.222;
  }
};


// Booleans can be objects (if defined with the new keyword)
// Numbers can be objects (if defined with the new keyword)
// Strings can be objects (if defined with the new keyword)
// Dates are always objects
// Maths are always objects
// Regular expressions are always objects
// Arrays are always objects
// Functions are always objects
// Objects are always objects
                
// Accessing property

var obj = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc"
};

obj.111      
// aaa

obj[111]      
// aaa              
                                  
// Accessing method

var obj = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc",
  444 : function() {
      return this.111 + this.222;
  }
};

var x = obj.444();
// aaabbb
                                                    
// Iterator

var obj = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc"
};

for (x in obj) {
  // obj[x]
  // aaa
}
                                                                      
// Delete property

var obj = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc"
};

delete obj.333; 
                                  
Constructor
Constructor
function obj_constr(val_1, val_2) {
  this.111 = val_1;
  this.222 = val_2;
  this.TEST = function() {
    return this.111+this.222;
  }
}

var x = obj_constr('aaa','bbb');
//  x = {
//   111 : "aaa",
//   222 : "bbb",
//   TEST : function() {
//     return this.111+this.222;
//   }
//  }

// BUILT IN CONSTRUCTORS
var x1 = new Object();    // A new Object object
var x2 = new String();    // A new String object
var x3 = new Number();    // A new Number object
var x4 = new Boolean();   // A new Boolean object
var x5 = new Array();     // A new Array object
var x6 = new RegExp();    // A new RegExp object
var x7 = new Function();  // A new Function object
var x8 = new Date();      // A new Date object

// RECOMMENDED
var x1 = {};            // new object
var x2 = "";            // new primitive string
var x3 = 0;             // new primitive number
var x4 = false;         // new primitive boolean
var x5 = [];            // new array object
var x6 = /()/           // new regexp object
var x7 = function(){};  // new function object
                
Accessors
Accessors
var obj = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc",
  get TEST() {
    return this.111;
  }
};

obj.TEST
// aaa
// GETTER


var obj = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc",
  set TEST(val) {
    this.111 = val;
  }
};

var x = "xxx";
obj.TEST = x;
// SETTER
                
Prototype
Prototype
function obj_constr(val_1, val_2) {
  this.111 = val_1;
  this.222 = val_2;
  this.TEST = function() {
    return this.111+this.222;
  }
}
var x = obj_constr('aaa','bbb');
var y = obj_constr('aaa','bbb');

obj_constr.prototype.333 = "ccc";
obj_constr.prototype.TEST2 = function() {
  return this.111+this.222;
};

x.333
// ccc

X.TEST2
// aaa+bbb

y.333
// ccc

y.TEST2
// aaa+bbb
                
.defineProperty()
.defineProperty()
var obj = {};

Object.defineProperty(obj, '111', {
  value: "aaa",

  writable: false,
  enumerable: false,
  configurable: false
});

obj.111;
// aaa


// Object.defineProperty(obj, prop, descriptor);
// Adds the named property described by a given descriptor to an object.
                
.defineProperties()
.defineProperties()
var obj = {};

Object.defineProperty(obj, {
  111 : {
    value: "aaa",
    writable: false,
    enumerable: false,
    configurable: false
  },
  222 : {
    value: "bbb",
    writable: false,
    enumerable: false,
    configurable: false
  }
});

obj.111;
// aaa

obj.222;
// bbb

// Object.defineProperties(obj, props)
// Adds the named properties described by the given descriptors to an object.
                
.getOwnPropertyDescriptor()
.getOwnPropertyDescriptor()
var obj = {
  111 : "aaa"
};

var x = Object.getOwnPropertyDescriptor(obj, '111');

// x = { 
//  value: "aaa", 
//  writable: true, 
//  enumerable: true, 
//  configurable: true 
// }


// Object.getOwnPropertyDescriptor(obj, prop)
// Returns a property descriptor for a named property on an object.
                
.getOwnPropertyDescriptors()
.getOwnPropertyDescriptors()
var obj = {
  111 : "aaa",
  222 : "bbb"
};

var x = Object.getOwnPropertyDescriptors(object1);

// x = { 
//  111 : { 
//    value: "aaa", 
//    writable: true, 
//    enumerable: true, 
//    configurable: true 
//  }, 
//  222: { 
//    value: "bbb", 
//    writable: true, 
//    enumerable: true, 
//    configurable: true 
//  }


// Object.getOwnPropertyDescriptors(obj)
// Returns an object containing all own property descriptors for an object.
                
.getOwnPropertyNames()
.getOwnPropertyNames()
var obj = {
  111 : "aaa",
  222 : "bbb"
};

var x = Object.getOwnPropertyNames(obj);

// x = ["111", "222"]

// Object.getOwnPropertyNames(obj)
// Returns an array containing the names of all of the given object's own enumerable and non-enumerable properties.
                
.getOwnPropertySymbols()
.getOwnPropertySymbols()
var obj = {};

obj[Symbol('a')] = 'localSymbol';
obj[Symbol.for('b')] = 'globalSymbol';

var x = Object.getOwnPropertySymbols(obj);

// x = [Symbol(a), Symbol(b)]


// Object.getOwnPropertySymbols(obj)
// Returns an array of all symbol properties found directly upon a given object.
                
.keys()
.keys()
var obj = {
  111 : "aaa",
  222 : "bbb"
};

var x = Object.keys(obj);

// x = ["111", "222"]

// Object.keys(obj)
// Returns an array containing the names of all of the given object's own enumerable string properties.
                
.values()
.values()
var obj = {
  111 : "aaa",
  222 : "bbb"
};

var x = Object.values(obj);

// x = ["aaa", "bbb"]


// Object.values(obj)
// Returns an array containing the values that correspond to all of a given object's own enumerable string properties.
                
.getPrototypeOf()
.getPrototypeOf()
var obj = {
  111 : "aaa"
};
var x = Object.create(obj);

// x = { 111: "aaa" }


// Object.getPrototypeOf(obj)
// Returns the prototype (internal [[Prototype]] property) of the specified object.
                
.setPrototypeOf()
.setPrototypeOf()
const obj1 = {
  111 : "aaa"
};
const obj2 = {
  111 : "bbb"
};
Object.setPrototypeOf(obj1, obj2);
var x = Object.getPrototypeOf(obj1);

// x = { 111: "bbb" }


// Object.setPrototypeOf(obj, prototype)
// Sets the object's prototype (its internal [[Prototype]] property).
                
.isExtensible()
.isExtensible()
var obj = {
  111 : "aaa"
};

var x = Object.isExtensible(obj);
// x = true


// Object.isExtensible(obj)
// Determines if extending of an object is allowed.
                
.preventExtensions()
.preventExtensions()
var obj = {
  111 : "aaa"
};

Object.preventExtensions(obj);
var x = Object.isExtensible(obj);
// x = false


// Object.preventExtensions(obj)
// Prevents any extensions of an object.
                
.seal()
.seal()
var obj = {
  111 : "aaa"
};

Object.seal(obj);

// delete object1.111 cannot be done


// Object.seal(obj)
// Prevents other code from deleting properties of an object.
                
.isSealed()
.isSealed()
var obj = {
  111 : "aaa"
};

var x = Object.isSealed(obj);

// x = false


// Object.isSealed(obj)
// Determines if an object is sealed.
                
.freeze()
.freeze()
const obj = {
  111 : "aaa"
};

Object.freeze(obj);

// delete object1.111 cannot be done
// object1.222 = "bbb" cannot be done


// Object.freeze(obj)
// Freezes an object. Other code cannot delete or change its properties.
                
.isFrozen()
.isFrozen()
var obj = {
  111 : "aaa"
};

var x = Object.isFrozen(obj);

// x = false


// Object.isFrozen(obj)
// Determines if an object was frozen.
                
.is()
.is()
Object.is('foo', 'foo');     // true
Object.is(window, window);   // true

Object.is('foo', 'bar');     // false
Object.is([], []);           // false

var foo = { a: 1 };
var bar = { a: 1 };
Object.is(foo, foo);         // true
Object.is(foo, bar);         // false

Object.is(null, null);       // true

// Special Cases
Object.is(0, -0);            // false
Object.is(-0, -0);           // true
Object.is(NaN, 0/0);         // true


// Object.is(value1, value2);
// Compares if two values are the same value. Equates all NaN values (which differs from both Abstract Equality Comparison and Strict Equality Comparison).
                
.assign()
.assign()
var obj1 = { 
  111 : "aaa", 
  222 : "bbb" 
};
var obj2 = { 
  222 : "BBB", 
  333 : "ccc" 
};

Object.assign(obj1, obj2);

// obj1 = { 
  111 : "aaa", 
  222 : "BBB",
  333 : "ccc"  
}


// Object.assign(target, source);
// Copies the values of all enumerable own properties from one or more source objects to a target object.
                
.create()
.create()
var obj1 = { 
  111 : "aaa", 
  222 : "bbb" 
};

var x = Object.create(obj1);
x.333 = "ccc";

//  x = {
//   333 : "ccc"
//  }

x.333;
// ccc

x.__proto__.111;
// aaa

x.111;
// aaa


// Object.create(proto, [propertiesObject]);
// Creates a new object with the specified prototype object and properties.
                
.entries()
.entries()
var obj = {
  111 : 'aaa',
  222 : 'bbb'
};

var x = Object.entries(obj);

// x = [["111", "aaa"], ["222", "bbb"]]


// Object.entries(obj)
// Returns an array containing all of the [key, value] pairs of a given object's own enumerable string properties.
                
.fromEntries()
.fromEntries()
var arr = [['111', 'aaa'],['222', 'bbb']];

var x = Object.fromEntries(arr);

// x = { 
//  111: "aaa", 
//  222: "bbb" 
// }



// Object.fromEntries(iterable);
// Returns a new object from an iterable of [key, value] pairs. 
                
String
str.concat()
str.concat()
var str1 = "Hello ";
var str2 = "world!";
var x = str1.concat(str2);
// Hello world!

// str.concat(str1, str2, ..., strX)
                
str.repeat()
str.repeat()
var str = "Hello world!";
var x = str.repeat();
// Hello world!Hello world!

// str.repeat(count)
                
str.slice()
str.slice()
var str = "Hello world!";
var x = str.slice(0, 5);
// Hello

// str.slice(start, end)
                
str.replace()
str.replace()
var str = "Hello world!";
var x = str.replace("Hello","Hi");
// Hi world!

// str.replace(searchvalue, newvalue)
                
str.charAt()
str.charAt()
var str = "HELLO WORLD";
var x = str.charAt(0)
// H

// str.charAt(index)
                
str.charCodeAt()
str.charCodeAt()
var str = "HELLO WORLD";
var n = str.charCodeAt(0);
// 72

// str.charCodeAt(index)
                
str.endsWith()
str.endsWith()
var str = "Hello world!";
var x = str.endsWith("d!");
// true


var str = "Hello world!";
var x = str.endsWith("d!",3);
// false

// str.endsWith(searchvalue, length)
                
str.startsWith()
str.startsWith()
var str = "Hello world!";
var x = str.startsWith("He");
// true


var str = "Hello world!";
var x = str.startsWith("d!",3);
// false

// str.startsWith(searchvalue, length)
                
str.indexOf()
str.indexOf()
var str = "Hello world!";
var x = str.indexOf("world");
// 6


var str = "Hello world!";
var x = str.indexOf("world",8);
// -1

// str.indexOf(searchvalue, start)
                
str.lastIndexOf()
str.lastIndexOf()
var str = "Hello world!";
var x = str.lastIndexOf("world");
// 6


var str = "Hello world!";
var x = str.lastIndexOf("world",8);
// 6

var str = "Hello world!";
var x = str.lastIndexOf("world",4);
// -1

// str.lastIndexOf(searchvalue, start)
                
str.includes()
str.includes()
var str = "Hello world!";
var x = str.includes("world");
// true


var str = "Hello world!";
var x = str.includes("world", 7);
// false

// str.includes(searchvalue, start)
                
str.search()
str.search()
var str = "Hello world!";
var x = str.search("world");
// 6

// str.search(searchvalue)
                
str.match()
str.match()
var str = "Hello world!"; 
var x = str.match(/o/g);
// 0,0

var str = "Hello world!"; 
var x = str.match(/xxx/g);
// null

// str.match(regexp)
                
str.split()
str.split()
var str = "Hello world!";
var x = str.split(" ");
// ["Hello","world!"]

var str = "Hello world!";
var x = str.split(" ",2);
// ["Hello","world!"]

// str.split(separator, limit)
                
str.substr()
str.substr()
var str = "Hello world!";
var x = str.substr(1, 4);
// ello


var str = "Hello world!";
var x = str.substr(2);
// llo world!

// str.substr(start, length)
                
str.substring()
str.substring()
var str = "Hello world!";
var x = str.substring(1, 4);
// ell


var str = "Hello world!";
var x = str.substring(2);
// llo world!

// str.substring(start, length)
                
str.toLowerCase()
str.toLowerCase()
var str = "Hello World!";
var x = str.toLowerCase();
// hello world!
                
str.toUpperCase()
str.toUpperCase()
var str = "Hello World!";
var x = str.toUpperCase();
// HELLO WORLD!
                
str.toLocaleLowerCase()
str.toLocaleLowerCase()
var str = "Hello World!";
var x = str.toLowerCase();
// hello world!
                
str.toLocaleUpperCase()
str.toLocaleUpperCase()
var str = "Hello World!";
var x = str.toUpperCase();
// HELLO WORLD!
                
str.trim()
str.trim()
var str = "   Hello World!   ";
var x = str.trim();
// Hello world!
                
str.localeCompare()
str.localeCompare()
var str1 = "ab";
var str2 = "cd";
var x = str1.localeCompare(str2);
// -1


var str1 = "cd";
var str2 = "ab";
var x = str1.localeCompare(str2);
// 1


var str1 = "ab";
var str2 = "ab";
var x = str1.localeCompare(str2);
// 0

// compare the two strings in the current locale.
// str.localeCompare(compareString)

// Returns -1 if str1 is sorted before str2
// Returns 0 if the two strings are equal
// Returns 1 if str1 is sorted after str2
                
.fromCharCode()
var x = String.fromCharCode(65);
// A


var x = String.fromCharCode(72, 69, 76, 76, 79);
// HELLO

// String.fromCharCode(n1, n2, ..., nX)
                
str.toString()
str.toString()
var str = "Hello world!";
var x = str.toString();
// Hello world!
                
str.valueOf()
str.valueOf()
var str = "Hello world!";
var x = str.valueOf();
// Hello world!
                
str.length
str.length
var str = "Hello world!";
var x = str.length;
// 12
                
Global
encodeURI()
encodeURI()
var str = "Hello world,/?:@&=+$#";
var x = encodeURI(str);

// x = Hello%20world,/?:@&=+$#
                
decodeURI()
decodeURI()
var str = "Hello world,/?:@&=+$#";
var x = encodeURI(str);
// x = Hello%20world,/?:@&=+$#

var y = decodeURI(x);
// y = Hello world,/?:@&=+$#
                
encodeURIComponent()
encodeURIComponent()
var str = "Hello world,/?:@&=+$#";
var x = encodeURIComponent(str);

// x = Hello%20world%2C%2F%3F%3A%40%26%3D%2B%24%23
                
decodeURIComponent()
decodeURIComponent()
var str = "Hello world,/?:@&=+$#";
var x = encodeURIComponent(str);
// x = Hello%20world%2C%2F%3F%3A%40%26%3D%2B%24%23

var y = encodeURIComponent(x);
// y = Hello world,/?:@&=+$#
                
NaN
NaN
var x = Number.NaN
// Not a number
                
undefined
undefined
var x = undefined
// undefined
                
Infinity
Infinity
var x = Number.NEGATIVE_INFINITY
// -Infinity

var x = Number.POSITIVE_INFINITY
// Infinity
                
eval()
eval()
var x = 10;
var y = 20;
var a = eval("x * y");
// a = 200



// eval(string)
//  evaluates or executes an argument.
                
isNaN()
isNaN()
isNaN(123) //false
isNaN(-1.23) //false
isNaN(5-2) //false
isNaN(0) //false
isNaN('123') //false
isNaN('Hello') //true
isNaN('2005/12/12') //true
isNaN('') //false
isNaN(true) //false
isNaN(undefined) //true
isNaN('NaN') //true
isNaN(NaN) //true
isNaN(0 / 0) //true
isNaN(null) //false


// Determines whether a value is an Not-a-Number
                
isFinite()
isFinite()
isFinite(123) //true
isFinite(-1.23) //true
isFinite(5-2) //true
isFinite(0) //true
isFinite('123') //false
isFinite('Hello') //false
isFinite('2005/12/12') //false
isFinite(Infinity) //false
isFinite(-Infinity) //false
isFinite(0 / 0) //false

// Determines whether a value is a finite number
                
parseInt()
parseInt()
parseInt("10"); // 10
parseInt("10.00"); // 10
parseInt("10.33"); // 10
parseInt("34 45 66"); // 34
parseInt("   60   "); // 60
parseInt("40 years"); // 40
parseInt("He was 40"); // NaN

parseInt("10", 10; // 10
parseInt("010"; // 10
parseInt("10", 8; // 8
parseInt("0x10"; // 16
parseInt("10", 16; // 16

//Parses a string and returns an integer.
                
parseFloat()
parseFloat()
parseFloat("10") // 10 
parseFloat("10.00") // 10
parseFloat("10.33") // 10.33
parseFloat("34 45 66") // 34
parseFloat("   60   ") // 60
parseFloat("40 years") // 40
parseFloat("He was 40") // NaN

// Parses a string and returns a floating point number.
                
String()
String()
var x1 = Boolean(0);
var x2 = Boolean(1);
var x3 = new Date();
var x4 = "12345";
var x5 = 12345;

String(x1) // false
  String(x2) // true
  String(x3) // Sun Oct 11 2020 19:45:10 GMT+0530 (India Standard Time)
  String(x4) // 12345
  String(x5); // 12345

// String(x1)
// Converts the value of an object to a string.
                
Number()
Number()
                  var x1 = true;
                  var x2 = false;
                  var x3 = new Date();
                  var x4 = "999";
                  var x5 = "999 888";
                
                  Number(x1) // 1
                  Number(x2) // 0
                  Number(x3); // 1602425900166
                  Number(x4); // 999
                  Number(x5); // NaN

// Number(object)
//  Converts the object argument to a number that represents the object's value
                
Window
self
self
// Returns the window itself
var x = window.self;

// Window {window: Window, self: Window, document: document, name: "", location: Location, …}

            
window
window
// Returns the window itself
var x = window.window;

// Window {window: Window, self: Window, document: document, name: "", location: Location, …}

            
frames
frames
// Returns the window itself
var x = window.frames;

// Window {window: Window, self: Window, document: document, name: "", location: Location, …}

            
parent
parent
// reference to the parent of the current window or subframe 
// If no parent, it is a reference to itself
var x = window.parent;

// Window {window: Window, self: Window, document: document, name: "", location: Location, …}

            
top
top
// reference to the topmost window in the window hierarchy
var x = window.top;

// Window {window: Window, self: Window, document: document, name: "", location: Location, …}

            
length
length
// Returns the length of frames in the window
var x = window.length;

// 0

            
innerHeight
innerHeight
// the height of the content area of the browser window including, if rendered, the horizontal scrollbar

var x = window.innerHeight;
// 798

// read only
            
innerWidth
innerWidth
// the width of the content area of the browser window including, if rendered, the vertical scrollbar

var x = window.innerWidth;
// 1389

// read only
            
outerHeight
outerHeight
// Gets the height of the outside of the browser window

var x = window.outerHeight;
// 877

// read only
            
outerWidth
outerWidth
// Gets the height of the outside of the browser window

var x = window.outerWidth;
// 1389

// read only
            
scrollX | pageXOffset
scrollX | pageXOffset
// returns the number of pixels that the document is currently scrolled horizontally
var x = window.scrollX;
var x = window.pageXOffset;

// read only
            
scrollY | pageYOffset
scrollY | pageYOffset
// returns the number of pixels that the document is currently scrolled vertically
var x = window.scrollY;
var x = window.pageYOffset;

// read only
            
screenX
screenX
// returns the horizontal distance, in CSS pixels
// the left border of the browser to the left side of the screen

var x = window.screenX;
// 0
            
screenLeft
screenLeft
// returns the horizontal distance, in CSS pixels
// the left border of the browser to the left side of the screen

var x = window.screenLeft;
// 0
            
screenY
screenY
// returns the horizontal distance, in CSS pixels
// the left border of the browser to the left side of the screen

var x = window.screenY;
// 0
            
screenTop
screenTop
// returns the vertical distance, in CSS pixels
// the left border of the browser to the left side of the screen

var x = window.screenTop;
// 0
            
locationbar
locationbar
// Returns the locationbar object, whose visibility can be checked

var x = window.locationbar;

// BarProp {visible: true}
            
menubar
menubar
// returns the menubar object, whose visibility can be checked

var x = window.menubar;

// BarProp {visible: true}
            
personalbar
personalbar
// returns the personalbar object, whose visibility can be checked

var x = window.personalbar;

// BarProp {visible: true}
            
scrollbars
scrollbars
// returns the scrollbars object, whose visibility can be checked

var x = window.scrollbars;

// BarProp {visible: true}
            
statusbar
statusbar
// returns the statusbar object, whose visibility can be toggled

var x = window.statusbar;

// BarProp {visible: true}
            
toolbar
toolbar
// returns the toolbar object, whose visibility can be toggled

var x = window.toolbar;

// BarProp {visible: true}
            
name
name
// gets/sets the name of the window's browsing context
window.name = "Some name";
var x = window.name;
            
opener
opener
// returns a reference to the window that opened the window
// either with open() or ink with a target attribute

var x = window.opener;
// null



// can be omitted by 
// target=noopener on a link
// passing noopener in the open()
            
devicePixelRatio
devicePixelRatio
// returns the ratio of the resolution in physical pixels 
// to the resolution in CSS pixels for the current display device

var x = window.devicePixelRatio;
// 2
            
// when the orientation of the device has changed (For mobile)

window.addEventListener("orientationchange", function(e) {});
window.onorientationchange = function(e) {};
            
// Called if accelerometer detects a change (mobile devices)
// Fired at a regular interval, 
// indicating the amount of physical force of acceleration the device is receiving 
// rate of rotation, if available

window.addEventListener("devicemotion", function(e) {});
window.ondevicemotion = function(e) {};
            
// Called when the orientation is changed (mobile devices)
// when fresh data is available from the magnetometer orientation sensor 
// about the current orientation of the device

window.addEventListener("deviceorientation", function(e) {});
window.ondeviceorientation = function(e) {};
            
// when a gamepad is connected

window.addEventListener("gamepadconnected", function(e) {});
window.ongamepadconnected = function(e) {};
            
// when a gamepad is disconnected

window.addEventListener("gamepaddisconnected", function(e) {});
window.ongamepaddisconnected = function(e) {};
            
// when Promises are rejected

window.addEventListener("rejectionhandled", function(e) {});
window.onrejectionhandled = function(e) {};
            
// when a JavaScript Promise is rejected but there is no handler in place to catch the rejection

window.addEventListener("unhandledrejection", function(e) {});
window.onunhandledrejection = function(e) {};
            
// fired at the global scope object when the user's preferred language changes

window.addEventListener("languagechange", function(e) {});
window.onlanguagechange = function(e) {};
            
// when the window has been resized

window.addEventListener("resize", function(e) {});
window.onresize = function(e) {};
            
// when a storage area (localStorage or sessionStorage) has been modified

window.addEventListener("storage", function(e) {});
window.onstorage = function(e) {};
            
// when the browser has lost access to the network

window.addEventListener("offline", function(e) {});
window.onoffline = function(e) {};
            
// when the browser has gained access to the network

window.addEventListener("online", function(e) {});
window.ononline = function(e) {};
            
// when the browser hides the current page
// in the process of presenting a different page from the session's history
// when the user clicks the browser's Back button
// the current page receives a pagehide event before the previous page is shown

window.addEventListener("pagehide", function(e) {});
window.onpagehide = function(e) {};
            
// when the browser makes the document visible
// Initially loading the page
// Navigating to the page from another page in the same window or tab
// Returning to the page using the browser's forward or back buttons

window.addEventListener("pageshow", function(e) {});
window.onpageshow = function(e) {};
            
// when the fragment identifier of the URL has changed

window.addEventListener("hashchange", function(e) {});
window.onhashchange = function(e) {};
            
// when the active history entry changes
// while the user navigates the session history

window.addEventListener("popstate", function(e) {});
window.onpopstate = function(e) {};
            
// when the window, the document and its resources are about to be unloaded
// when leaving page

window.addEventListener("beforeunload", function(e) {});
window.onbeforeunload = function(e) {};
            
// when the document has been completely loaded and parsed
// without waiting for stylesheets, images, and subframes to finish loading
window.addEventListener("DOMContentLoaded", function(e) {});
window.onDOMContentLoaded = function(e) {};
            
// when the whole page has loaded
// including all dependent resources such as stylesheets images

window.addEventListener("load", function(e) {});
window.onload = function(e) {};
            
// when the document or a child resource is being unloaded.

window.addEventListener("unload", function(e) {});
window.onunload = function(e) {};
            
// after the associated document has started printing 
// the print preview has been closed

window.addEventListener("afterprint", function(e) {});
window.onafterprint = function(e) {};
            
// when the associated document is about to be printed 
// previewed for printing

window.addEventListener("beforeprint", function(e) {});
window.onbeforeprint = function(e) {};
            
caches
caches
// Returns the CacheStorage object associated with the current context
var x = window.caches;

// CacheStorage {}
            
indexedDB
indexedDB
// returns an IDBFactory object
var x = window.indexedDB;

// IDBFactory {}
            
isSecureContext
isSecureContext
// Returns a boolean indicating whether the current context is secure (true) or not (false)
var x = window.isSecureContext;

// true
            
origin
origin
// Returns the origin of the global scope, serialized as a string
var x = window.origin;

//"null"
            
console
console
// provides access to the browser's debugging console

window.console.log("Some text");
console.log("Some text");

            
alert()
alert()
// Displays an alert dialog

window.alert("Some text");
alert("Some text");
            
confirm()
confirm()
// displays a modal dialog with an optional message and two buttons 'OK' and 'Cancel'

window.confirm('some text');
            
prompt()
prompt()
// displays a dialog with an optional message prompting the user to input some text

var x = window.prompt('Some heading', 'some input value');

// window.prompt(message, default_val);
            
blur()
blur()
// Shifts focus away from the window

window.blur();

            
focus()
focus()
// Makes a request to bring the window to the front

window.focus();
            
close()
close()
// Closes the current window

window.close();

            
stop()
stop()
// stops further resource loading in the current browsing context

window.stop()
            
getComputedStyle()
getComputedStyle()
// returns an object containing the values of all CSS properties of an element,

var x = document.body;
var y = window.getComputedStyle(x);
            
getSelection()
getSelection()
var x = window.getSelection();
// returns selected text object
            
moveBy()
moveBy()
// moves the current window by a specified amount

window.moveBy(10, -10);

// can't move a window or tab that wasn’t created by Window.open().
// can't move a window or tab when it’s in a window with more than one tab.
            
moveTo()
moveTo()
// moves the current window by a specified amount

window.moveTo(0, 0);

// can't move a window or tab that wasn’t created by Window.open().
// can't move a window or tab when it’s in a window with more than one tab.
            
open()
open()
// loads the specified resource into the new/existing browsing context with the specified name
// If no name, then a new browsing context is opened in a new tab/window and the specified resource is loaded

var Features = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes";
window.open("www.fallinfo.com", "FALLINFO", Features)

// var window = window.open(url, windowName, [windowFeatures]);
            
print()
print()
// Opens the Print Dialog to print the current document

window.print();
            
resizeBy()
resizeBy()
// resizes the current window by a specified amount

window.resizeBy(-200, -200);

// window.resizeBy(xDelta, yDelta) 

// To make the window resizable
// open it with the "resizable" feature
            
resizeTo()
resizeTo()
// resizes the current window by a specified amount

window.resizeTo(10, 10);

// window.resizeTo(width, height)

// It's not possible to resize a window or tab 
// that wasn’t created by window.open()
// when the window has multiple tabs
            
scroll()
scroll()
// scrolls the window to a particular place in the document

window.scroll(0, 100);

window.scroll({
  top: 100,
  left: 100,
  behavior: 'smooth'
});

// no safari support
            
scrollBy()
scrollBy()
// Scrolls the document in the window by the given amount

window.scrollBy({
  top: 100,
  left: 100,
  behavior: 'smooth'
});

// To scroll down one page:
window.scrollBy(0, window.innerHeight);

// To scroll up:
window.scrollBy(0, -window.innerHeight);

// no safari support
            
scrollTo()
scrollTo()
// Scrolls to a particular set of coordinates in the document

window.scrollTo(0, 1000);

window.scrollTo({
  top: 100,
  left: 100,
  behavior: 'smooth'
});

// no safari support
            
atob()
atob()
// decodes a string of data which has been encoded using Base64 encoding / btoa()

var x = window.btoa('some_text'); // encode a string
var y = window.atob(x); // decode the string
            
btoa()
btoa()
// creates a Base64-encoded ASCII string from a binary string

var x = window.btoa('some_text'); // encode a string
var y = window.atob(x); // decode the string
            
setTimeout()
setTimeout()
// Schedules a function to execute in a given amount of time

var x = window.setTimeout(function(){ 
  // code 
}, 3000);

// setTimeout(function, milliseconds, param1, param2, ...)
            
setInterval()
setInterval()
// Schedules a function to execute every time a given number of milliseconds elapses

var x = setInterval(function(){ 
  // code
 }, 3000);

 // setInterval(function, milliseconds, param1, param2, ...)
            
clearTimeout()
clearTimeout()
// Cancels the delayed execution set using

var x = window.setTimeout(function(){ 
  // code 
}, 3000);

clearTimeout(x)
            
clearInterval()
clearInterval()
// Cancels the repeated execution set using

var x = setInterval(function(){ 
  // code
 }, 3000);

clearInterval(x)
            
fetch()
fetch()
// Starts the process of fetching a resource from the network

var x = fetch(resource [, init])
            
createImageBitmap()
createImageBitmap()
// Accepts a variety of different image sources, and returns a Promise which resolves to an ImageBitmap

var imageBitmapPromise = createImageBitmap(image[, options]);
var imageBitmapPromise = createImageBitmap(image, sx, sy, sw, sh[, options]);
            
queueMicrotask()
queueMicrotask()
// Enqueues a microtask—a short function to be executed after execution of the 
// JavaScript code completes and control isn't being returned to a JavaScript caller,
//  but before handling callbacks and other tasks.

window.queueMicrotask(function);
            
Window MediaQueryList
matches
matches
// A Boolean that returns true if the document currently matches the media query list, or false if not

var x = window.matchMedia('(max-width: 6000px)');
var y = x.matches;
// true

// read only 
                            
media
media
// A DOMString representing a serialized media query

var x = window.matchMedia('(max-width: 6000px)');
var y = x.media;
// (max-width: 6000px)

// read only 
                            
matchMedia()
matchMedia()
// returns a new MediaQueryList object that can then be 
// used to determine if the document matches the media query string
// to detect when it matches (or stops matching) that media query

var x = window.matchMedia('(max-width: 600px)');
var x = window.matchMedia('(orientation:landscape)');
                
addListener()
addListener()
// Adds to the MediaQueryList a callback which is 
// invoked whenever the media query status changes

var x = window.matchMedia('(max-width: 6000px)');

function fn_name(e) {
// code
}

x.addListener(fn_name);
                
removeListener()
removeListener()
// Removes the specified listener callback from the callbacks 
// to be invoked when the MediaQueryList changes media query status

var x = window.matchMedia('(max-width: 6000px)');

function fn_name(e) {
// code
}

x.addListener(fn_name);
x.removeListener(fn_name);
                
Window Storage
length
length
// Returns an integer representing the number of data items stored in the Storage object

var x = localStorage.length;
var x = sessionStorage.length;
                 
key()
key()
// When passed a number n, this method will return the name of the nth key in the storage

for(var i =0; i < localStorage.length; i++){
  // code
}

for(var i =0; i < sessionStorage.length; i++){
  // code
}
                
getItem()
getItem()
// When passed a key name, will return that key's value

var x = localStorage.getItem('item_name');
var x = sessionStorage.getItem('item_name');
                
setItem()
setItem()
// When passed a key name and value, will add that key to the storage,
// or update that key's value if it already exists

localStorage.setItem('item_name', 'item_value');
sessionStorage.setItem('item_name', 'item_value');
                
removeItem()
removeItem()
// When passed a key name, will remove that key from the storage

localStorage.removeItem('item_name');
sessionStorage.removeItem('item_name');
                
clear()
clear()
// When invoked, will empty all keys out of the storage

localStorage.clear();
sessionStorage.clear();
                
Window Screen
availHeight
availHeight
// Specifies the height of the screen, in pixels 
// minus user interface features displayed by the operating system

var x = window.screen.availHeight;
// 877
                 
availWidth
availWidth
// Returns the amount of horizontal space in pixels available to the window

var x = window.screen.availWidth;
// 1389
                 
colorDepth
colorDepth
// Returns the color depth of the screen

var x = window.screen.colorDepth;
// 24
                 
height
height
// Returns the height of the screen in pixels

var x = window.screen.height;
// 900

                 
orientation
orientation
// Returns the ScreenOrientation instance associated with this screen

var x = window.screen.orientation;
// ScreenOrientation {angle: 0, type: "landscape-primary", onchange: null}

var y = x.angle;
var y = x.type;

x.addEventListener('change', function(e) { // code })
x.onchange = function(e) { // code }

x.lock(orientation);
x.unlock();

// "any"
// "natural"
// "landscape"
// "portrait"
// "portrait-primary"
// "portrait-secondary"
// "landscape-primary"
// "landscape-secondary"
                 
pixelDepth
pixelDepth
// Gets the bit depth of the screen

var x = window.screen.pixelDepth;
// 24

                 
width
width
// Returns the width of the screen

var x = window.screen.width;
// 1440
                 
Window Location
ancestorOrigins
ancestorOrigins
// Is a static DOMStringList containing, in reverse order, the origins of all ancestor
//  browsing contexts of the document associated with the given Location object

var x = window.location.ancestorOrigins;
// DOMStringList {length: 0}
                 
href
href
// Is a stringifier that returns a USVString containing the entire URL. 
// If changed, the associated document navigates to the new page.

var x = window.location.href;
// 'https://www.fallinfo.com/some_page'
                 
protocol
protocol
// Is a USVString containing the protocol scheme of the URL, including the final ':'

var x = window.location.protocol;
// 'https:'
                 
host
host
// Is a USVString containing the host, that is the hostname, a ':', and the port of the URL

var x = window.location.host;
                 
hostname
hostname
// Is a USVString containing the domain of the URL

var x = window.location.hostname;
                 
port
port
// Is a USVString containing the port number of the URL

var x = window.location.port;
                 
pathname
pathname
// Is a USVString containing an initial '/' followed by the path of the URL

var x = window.location.pathname;
// "/some_page.html"
                 
search
search
// Is a USVString containing a '?' followed by the parameters or "querystring" of the URL

var x = window.location.search;
var x = URL.searchParams;
// "?some_search_query"
                 
hash
hash
// Is a USVString containing a '#' followed by the fragment identifier of the URL

var x = window.location.hash;
// "#some_hash_query"
                 
origin
origin
// Returns a USVString containing the canonical form of the origin of the specific location

var x = window.location.origin;
// 'https://www.fallinfo.com'
// "file://"
                 
assign()
assign()
// Loads the resource at the URL provided in parameter

window.location.assign('new_url');
                 
reload()
reload()
// Reloads the current URL, like the Refresh button

window.location.reload();

                 
replace()
replace()
// Replaces the current resource with the one at the provided URL

window.location.replace('new_url');
                 
toString()
toString()
// Returns a USVString containing the whole URL

var x = document.getElementById("some_anchor_element");
var y = x.toString();
                 
Window History
length
length
// Returns an Integer representing the number of elements
//  in the session history, including the currently loaded page

var x = window.history.length;
// 1
                 
scrollRestoration
scrollRestoration
// Allows web applications to explicitly set 
// default scroll restoration behavior on history navigation

var x = window.history.scrollRestoration;
// 'auto'

window.history.scrollRestoration = 'manual';
                 
state
state
// Returns an any value representing the state at the top of the history stack
// value is null until the pushState() or replaceState() method is used

var x = window.history.state;
// null
                 
back()
back()
// This asynchronous method goes to the previous page in session history

window.history.back();
                 
forward()
forward()
// This asynchronous method goes to the next page in session history

window.history.forward();
                 
go()
go()
// Asynchronously loads a page from the session history
// identified by its relative location to the current page,

history.go();
history.go(-1);
history.go(1);
                 
pushState()
pushState()
// Pushes the given data onto the session history stack with the specified title

var state = { 'page_id': 1, 'user_id': 5 }
var title = ''
var url = 'some_name.html'

history.pushState(state, title, url);
                 
replaceState()
replaceState()
// Updates the most recent entry on the history stack
// to have the specified data, title, and, if provided, URL

var state = { foo: 'some_id' };
history.pushState(state, '', 'some_title_1.html');

history.replaceState(state, '', 'some_title_2.html');
                 
Window Navigator
cookieEnabled
cookieEnabled
// returns a Boolean value that indicates whether cookies are enabled or not

var x = window.navigator.cookieEnabled;
// true
                 
deviceMemory
deviceMemory
// Returns the amount of device memory in gigabytes

var x = window.navigator.deviceMemory;
// 8

// No safari
                 
hardwareConcurrency
hardwareConcurrency
// returns the number of logical processors available to run threads on the user's computer

var x = window.navigator.hardwareConcurrency;
// 4
                 
language
language
// returns a string representing the preferred 
// language of the user, usually the language of the browser UI

var x = window.navigator.language;
// "en"
                 
languages
languages
// Returns an array of DOMString representing the 
// languages known to the user, by order of preference

var x = window.navigator.languages;
// ["en-GB", "en-US", "en", "ta", "es"]
                 
maxTouchPoints
maxTouchPoints
// returns the maximum number of simultaneous 
// touch contact points are supported by the current device

var x = window.navigator.maxTouchPoints;
// 0
                 
userAgent
userAgent
// returns the user agent string for the current browser

var x = window.navigator.userAgent;
// "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

                 
onLine
onLine
// returns a boolean value, with true meaning online and false meaning offline

var x = window.navigator.onLine;
// true
                 
vendor
vendor
// Returns the vendor name of the current browser

var x = window.navigator.vendor;
// "Google Inc."

                 
Classes
constructor
constructor
class obj_constr {
  constructor(val) {
    this.aaa = val;
  }
}

var x = new obj_constr("aaa");
x.aaa
// aaa
                        
super
super
class obj_constr_1 {
  constructor(val_1) {
    this.aaa = val_1;
  }
}

class obj_constr_2 extends obj_constr_1 {
  constructor(val_1, val_2) {
    super(val_1);
    this.bbb = val_2;
  }
}

var x = new obj_constr_2("aaa", "bbb");
x.aaa;
// aaa
                        
extends
extends
class obj_constr_1 {
  constructor(val_1) {
    this.aaa = val_1;
  }
  TEST1() {
    return this.aaa;
  }
}

class obj_constr_2 extends obj_constr_1 {
  constructor(val_1, val_2) {
    super(val_1);
    this.bbb = val_2;
  }
  TEST2() {
    return this.TEST1();
  }
}

var x = new obj_constr_2("aaa", "bbb");
x.TEST2();
// aaa
                        
static
static
class obj_constr {
  constructor(val) {
    this.aaa = val;
  }
  static TEST() {
    // Code
  }
}

var x = new obj_constr("aaa");

obj_constr.TEST();
                        
Date
date.getDay()
date.getDay()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getDay();
// 6

// Sun - 0
// Mon - 1
// Tue - 2
// Wed - 3
// Thu - 4
// Fri - 5
// Sat - 6
                
date.getMonth()
date.getMonth()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getMonth();
// 96

// Jan - 0
// Feb - 1
// Mar - 2
// Apr - 3
// May - 4
// Jun - 5
// Jul - 6
// Aug - 7
// Sep - 8
// Oct - 9
// Nov - 10
// Dec - 11
                
date.getDate()
date.getDate()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getDate();
// 3 (1 - 31)
                
date.getFullYear()
date.getFullYear()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getFullYear();
// 2020
                
date.getHours()
date.getHours()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getHours();
// 14 (0 - 23)
                
date.getMinutes()
date.getMinutes()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getMinutes();
// 57 (0 - 59)
                
date.getSeconds()
date.getSeconds()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getSeconds();
// 47 (0 - 59)
                
date.getMilliseconds()
date.getMilliseconds()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getMilliseconds();
// 0 (0 - 999)
                
date.getUTCDay()
date.getUTCDay()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCDay(); 
// 6

// Sun - 0
// Mon - 1
// Tue - 2
// Wed - 3
// Thu - 4
// Fri - 5
// Sat - 6
                
date.getUTCMonth()
date.getUTCMonth()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCMonth();
// 9

// Jan - 0
// Feb - 1
// Mar - 2
// Apr - 3
// May - 4
// Jun - 5
// Jul - 6
// Aug - 7
// Sep - 8
// Oct - 9
// Nov - 10
// Dec - 11
                
date.getUTCDate()
date.getUTCDate()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCDate();
// 3 (1 - 31)
                
date.getUTCFullYear()
date.getUTCFullYear()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCFullYear();
// 2020
                
date.getUTCHours()
date.getUTCHours()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCHours();
// 9 (0 - 23)
                
date.getUTCMinutes()
date.getUTCMinutes()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCMinutes();
// 42 (0 - 59)
                
date.getUTCSeconds()
date.getUTCSeconds()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCSeconds();
// 56 (0 - 56)
                
date.getUTCMilliseconds()
date.getUTCMilliseconds()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getUTCMilliseconds();
// 48 (0 - 999)
                
date.getTime()
date.getTime()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getTime();
// 1601718244579
// ms since January 1, 1970
                
date.setTime()
date.setTime()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.setTime(1332403882588);
// Thu Mar 22 2012 13:41:22 GMT+0530 (India Standard Time)
// add ms to January 1, 1970
                
date.getTimezoneOffset()
date.getTimezoneOffset()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.getTimezoneOffset();
// -330		
// Diff - UTC time and local time, in min
                
.now()
.now()
var x = Date.now();
// 1601718553895
// ms since January 1, 1970
                
.parse()
.parse()
var x = Date.parse("March 21, 2012");
// 1332268200000
// ms since January 1, 1970 to March 21, 2012
                
.UTC()
.UTC()
var x = Date.UTC(2012, 02, 30);
// 1333065600000
// ms since January 1, 1970 to 2012, 02, 30
                
date.setMonth()
date.setMonth()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setMonth(4);
// Sun May 03 2020 15:27:03 GMT+0530 (India Standard Time)
                
date.setDate()
date.setDate()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setDate(15);
// Thu Oct 15 2020 15:27:22 GMT+0530 (India Standard Time)
                
date.setFullYear()
date.setFullYear()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setFullYear(2020);
// Sat Oct 03 2020 15:27:38 GMT+0530 (India Standard Time)
                
date.setHours()
date.setHours()
var date = new Date();
// Sat Oct 03 2020 15:31:42 GMT+0530 (India Standard Time)

date.setHours(16);
// Sat Oct 03 2020 16:31:42 GMT+0530 (India Standard Time)
                
date.setMinutes()
date.setMinutes()
var date = new Date();
// Sat Oct 03 2020 15:32:17 GMT+0530 (India Standard Time)

date.setMinutes(40);
// Sat Oct 03 2020 15:40:17 GMT+0530 (India Standard Time)
                
date.setSeconds()
date.setSeconds()
var date = new Date();
// Sat Oct 03 2020 15:33:02 GMT+0530 (India Standard Time)

date.setSeconds(20);
// Sat Oct 03 2020 15:33:20 GMT+0530 (India Standard Time)
                
date.setMilliseconds()
date.setMilliseconds()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setMilliseconds(100);
                
date.setUTCMonth()
date.setUTCMonth()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setUTCMonth(4);
// Sun May 03 2020 15:37:00 GMT+0530 (India Standard Time)
                
date.setUTCDate()
date.setUTCDate()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setUTCDate(15);
// Thu Oct 15 2020 15:37:27 GMT+0530 (India Standard Time)
                
date.setUTCFullYear()
date.setUTCFullYear()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setUTCFullYear(2020);
// Sat Oct 03 2020 15:38:46 GMT+0530 (India Standard Time)
                
date.setUTCHours()
date.setUTCHours()
var date = new Date();
// Sat Oct 03 2020 15:40:34 GMT+0530 (India Standard Time)

date.setUTCHours(15);
// Sat Oct 03 2020 20:40:34 GMT+0530 (India Standard Time)
                
date.setUTCMinutes()
date.setUTCMinutes()
var date = new Date();
// Sat Oct 03 2020 15:41:19 GMT+0530 (India Standard Time)

date.setUTCMinutes(17);
// Sat Oct 03 2020 15:47:19 GMT+0530 (India Standard Time)
                
date.setUTCSeconds()
date.setUTCSeconds()
var date = new Date();
// Sat Oct 03 2020 15:42:18 GMT+0530 (India Standard Time)

date.setUTCSeconds(35);
// Sat Oct 03 2020 15:42:35 GMT+0530 (India Standard Time)
                
date.setUTCMilliseconds()
date.setUTCMilliseconds()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

date.setUTCMilliseconds(100);
                
date.toString()
date.toString()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.toString();
// Sat Oct 03 2020 15:50:16 GMT+0530 (India Standard Time)
                
date.toLocaleString()
date.toLocaleString()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.toLocaleString();
// 03/10/2020, 15:50:39
                
date.toISOString()
date.toISOString()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.toISOString();
// 2020-10-03T10:20:45.882Z
                
date.toJSON()
date.toJSON()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.toJSON();
// 2020-10-03T10:20:52.042Z
                
date.valueOf()
date.valueOf()
var date = new Date();
// Sat Oct 03 2020 14:57:47 GMT+0530 (India Standard Time)

var x = date.valueOf();
// 1601720459168
                
date.toTimeString()
date.toTimeString()
var date = new Date();
// Sat Oct 03 2020 15:52:09 GMT+0530 (India Standard Time)

var x = date.toTimeString();
// 15:52:09 GMT+0530 (India Standard Time)
                
date.toDateString()
date.toDateString()
var date = new Date();
// Sat Oct 03 2020 15:52:49 GMT+0530 (India Standard Time)

var x = date.toDateString();
// Sat Oct 03 2020
                
date.toLocaleTimeString()
date.toLocaleTimeString()
var date = new Date();
// Sat Oct 03 2020 15:53:15 GMT+0530 (India Standard Time)

var x = date.toLocaleTimeString();
// 15:53:15
                
date.toLocaleDateString()
date.toLocaleDateString()
var date = new Date();
// Sat Oct 03 2020 15:53:36 GMT+0530 (India Standard Time)

var x = date.toLocaleDateString();
// 03/10/2020
                
Operators
Arithmetic
// Addition +	
x = 5 + 2	// x = 7	

// Subtraction -	
x = 5 - 2	// x = 3	

// Multiplication *	
x = 5 * 2	// x = 10	

// Division /	
x = 5 / 2	// x = 2.5	

// Modulus (division remainder) %	
x = 5 % 2	// x = 1	

// Increment ++	
x = ++6	// x = 6	
x = 6++	//x = 5	

// Decrement	--
x = --4	// x = 4	
x = 4--	// x = 5

// Exponentiation **
x = 5 ** 2 // x = 25
                
Assignment
var x = 10

// Equal to =	
x = 5	// x = 5	

// Add to variable +=	
x += 5	// x = 15	

// Subtract to varialbe -=	
x -= 5	// x = 5	

// Multiply to varialbe *=	
x *= 5	// x = 50

// Divide to varialbe /=	
x /= 5	// x = 2	

// Modulus to varialbe %=	
x %= 5	// x = 0



// Left shift to varialbe <<=
// Right shift to varialbe >>=
// Right shift unsigned to varialbe >>>=
// AND to varialbe &=
// XOR to varialbe ^=
// OR to varialbe |=
                
Comparison
// Equal to ==	
x == 8	// false	

// Equal value and equal type ===
x === "5"	// false	

// Not equal !=
x != 8	// true	

// Not equal value or not equal type !==	
x !== "5"	// true	

// Greater than >	
x > 8	// false	

// Less than <	
x < 8	// true	

// Greater than or equal to >=	 
x >= 8	// false	

// Less than or equal to <=	
x <= 8	// true
                
Conditional / Ternary
var x = (condition) ? if : else;
                
Logical
// and	&&	
(6 < 10 && 3 > 1) is true	

// or ||	
(6 === 5 || 3 === 5) is false	

// not !	
!(6 === 3) is true
                
Bitwise
// AND &	
x = 5 & 1	
0101 & 0001	// 0001 // 1

// OR | 	
x = 5 | 1	
0101 | 0001	// 0101 // 5

// NOT ~	
x = ~ 5	 
~0101	// 1010 // 10

// XOR ^
x = 5 ^ 1	
0101 ^ 0001	// 0100 // 4

// Left shift <<
x = 5 << 1	
0101 << 1	// 1010 // 10

// Right shift >>
x = 5 >> 1	
0101 >> 1	// 0010 // 2

// Right shift unsigned >>>
x = 5 >>> 1	

                
delete
var obj = {
  111 : "aaa",
  222 : "bbb",
  333 : "ccc"
};

delete obj.333; 


// The delete operator deletes a property from an object.
                
in
// Arrays
var cars = ["Saab", "Volvo", "BMW"];
"Saab" in cars          // Returns false (specify the index number instead of value)
0 in cars               // Returns true
1 in cars               // Returns true
4 in cars               // Returns false (does not exist)
"length" in cars        // Returns true  (length is an Array property)

// Objects
var person = {firstName:"John", lastName:"Doe", age:50};
"firstName" in person   // Returns true
"age" in person         // Returns true

// Predefined objects
"PI" in Math            // Returns true
"NaN" in Number         // Returns true
"length" in String      // Returns true


// The in operator returns true if the specified property is in the specified object, otherwise false.
                
typeof
typeof "John"                 // Returns string
typeof 3.14                   // Returns number
typeof NaN                    // Returns number
typeof false                  // Returns boolean
typeof [1, 2, 3, 4]           // Returns object
typeof {name:'John', age:34}  // Returns object
typeof new Date()             // Returns object
typeof function () {}         // Returns function
typeof myCar                  // Returns undefined (if myCar is not declared)
typeof null                   // Returns object


// The typeof operator returns the type of a variable, object, function or expression.
                
instanceof
var cars = ["Saab", "Volvo", "BMW"];

cars instanceof Array;          // Returns true
cars instanceof Object;         // Returns true
cars instanceof String;         // Returns false
cars instanceof Number;         // Returns false


// The instanceof operator returns true if the specified object is an instance of the specified object.
                
void
// href="javascript:void(0);"

javascript:void(0);

// The void operator evaluates an expression and returns undefined. This operator is often used to obtain the undefined primitive value, using "void(0)"
                
Element
contentEditable
contentEditable
// whether or not the element is editable
var x = document.getElementById('id_name');
var y = x.contentEditable;

// true/false

  
isContentEditable
isContentEditable
// whether or not the element is editable
var x = document.getElementById('id_name');
var y = x.isContentEditable;

// read only
  
dataset
dataset
// returns DOM string map
var x = document.getElementById('id_name');
x.dataset.custom_attr === 'abc';

delete x.dataset.custom_attr;
  
hidden
hidden
var x = document.getElementById('id_name');
var y = xmlEncoding.hidden;
// false

// read only
dir
dir
var x = document.getElementById('id_name');
var y = x.dir;
// "rlt"

document.dir = "rtl";
document.dir = "ltr";

// text direction

innerText
innerText
// text inside html
var x = document.getElementById('id_name')
x.innerText = "Some text"
  
lang
lang
// gets or sets the base language of an element's attribute values and text content
var x = document.getElementById('id_name');
var y = x.lang; 
  
offsetHeight
offsetHeight
// Returns a double containing the height of an element, relative to the layout
var x = document.getElementById('id_name');
var y = x.offsetHeight;
  
offsetLeft
offsetLeft
// Returns a double, the distance from this element's left border to its offsetParent's left border
var x = document.getElementById('id_name');
var y = x.offsetLeft;
  
offsetTop
offsetTop
// Returns a double, the distance from this element's top border to its offsetParent's top border
var x = document.getElementById('id_name');
var y = x.offsetTop;
  
offsetParent
offsetParent
// Returns a Element that is the element from which all offset calculations are currently computed
var x = document.getElementById('id_name');
var y = x.offsetParent;
  
offsetWidth
offsetWidth
// Returns a double containing the width of an element, relative to the layout
var x = document.getElementById('id_name');
var y = x.offsetWidth;
  
scrollHeight
scrollHeight
// is a measurement of the height of an element's content
// including content not visible on the screen due to overflow

var x = document.getElementById('id_name');
var y = x.scrollHeight;
// 3328

// read only

scrollLeft
scrollLeft
// gets or sets the number of pixels that an element's content is scrolled from its left edge

var x = document.getElementById('id_name');
var y = x.scrollLeft;
// 0

scrollTop
scrollTop
// gets or sets the number of pixels that an element's content is scrolled vertically

var x = document.getElementById('id_name');
var y = x.scrollTop;
// 0

scrollWidth
scrollWidth
//  is a measurement of the width of an element's content
// including content not visible on the screen due to overflow

var x = document.getElementById('id_name');
var y = x.scrollWidth;
// 1357

clientHeight
clientHeight
// Returns a Number representing the inner height of the element
// zero for elements with no CSS or inline layout boxes
// otherwise, it's the inner height of an element in pixels

var x = document.getElementById('id_name');
var y = x.clientHeight;
// 3328

// read only

clientLeft
clientLeft
// Returns a Number representing the width of the left border of the element
// The width of the left border of an element in pixels

var x = document.getElementById('id_name');
var y = x.clientLeft;
// 0

// read only

clientTop
clientTop
// Returns a Number representing the width of the top border of the element
// The width of the top border of an element in pixels

var x = document.getElementById('id_name');
var y = x.clientTop;
// 0

// read only

clientWidth
clientWidth
// Returns a Number representing the inner width of the element
// zero for inline elements and elements with no CSS
// otherwise, it's the inner width of an element in pixels

var x = document.getElementById('id_name');
var y = x.clientWidth;
// 1357

// read only
style
style
// get/set the inline style of an element
var x = document.getElementById('id_name');
var y = x.style.color = "red";
  
tabIndex
tabIndex
// represents the tab order of the current element
var x = document.getElementById('id_name');
var y = x.tabIndex;
  
title
title
// represents the title
// the text usually displayed in a 'tooltip'
var x = document.getElementById('id_name');
x.title = "some text";
  
accessKey
accessKey
// sets the keystroke which a user can press to jump to a given element
var x = document.getElementById('id_name');
x.accessKey = "a";

  
inert
inert
//  when present, may make the browser "ignore" the element from assistive technologies, page search and text selection
var x = document.getElementById('id_name');
x.inert = true;
  
attributes
attributes
// returns a live collection of all attribute nodes registered to the specified node
var x = document.getElementById('id_name');
var y = x.attributes;
// NamedNodeMap {0: id, 1: class, id: id, class: class, length: 2}

// read only
classList
classList
// returns a live DOMTokenList collection of the class attributes of the element
var x = document.getElementById('id_name');
var y = x.classList;
// DOMTokenList ["class_name", value: "class_value"];

// read only

id
id
// Is a DOMString representing the id of the element
var x = document.getElementById('id_name');
var y = x.id;
// "some_id"

className
className
// Is a DOMString representing the classes of the element
var x = document.getElementById('id_name');
var y = x.className;
// "some_class_name"
innerHTML
innerHTML
// gets or sets the HTML or XML markup contained within the element

var x = document.getElementById('id_name');
var y = x.innerHTML;
// HTML element

outerHTML
outerHTML
// Is a DOMString representing the markup of the element including its content
// When used as a setter, replaces the element with nodes parsed from the given string

var x = document.getElementById('id_name');
var y = x.outerHTML;
// HTML element

nextElementSibling
nextElementSibling
// The element immediately following the given one in the tree
// null if there's no sibling node

var x = document.getElementById('id_name');
var y = x.nextElementSibling;
// next element ref

// read only

previousElementSibling
previousElementSibling
// The element immediately preceding the given one in the tree
// null if there's no sibling node

var x = document.getElementById('id_name');
var y = x.previousElementSibling;
// next element ref

// read only

part
part
// Represents the part identifier(s) of the element 
// set using the part attribute 
// returned as a DOMTokenList.

var x = document.getElementById('id_name');
var y = x.part;
// DOMTokenList [value: ""]

shadowRoot
shadowRoot
// represents the shadow root hosted by the element

var x = document.getElementById('id_name');
var y = x.shadowRoot;
// null

slot
slot
// returns the name of the shadow DOM slot the element is inserted in

var x = document.getElementById('id_name');
var y = x.slot;
// ""

localName
localName
// A DOMString representing the local part of the qualified name of the element

var x = document.getElementById('id_name');
var y = x.localName;
// "div"

// read only
tagName
tagName
// returns the tag name of the element on which it's called

var x = document.getElementById('id_name');
var y = x.tagName;
// "DIV"

// when beforeinputed
el.addEventListener('beforeinput', fn_name(e));

el.onbeforeinput = function(){ // code )};

< element onbeforeinput="code">
// hen a text composition system such as an input method editor 
// completes or cancels the current composition session

el.addEventListener('compositionend', fn_name(e));

el.oncompositionend = function(){ // code )};

< element oncompositionend="code">
// hen a text composition system such as an input method editor 
// completes or cancels the current composition session

el.addEventListener('compositionstart', fn_name(e));

el.oncompositionstart = function(){ // code )};

< element oncompositionstart="code">
// hen a text composition system such as an input method editor 
// completes or cancels the current composition session

el.addEventListener('compositionupdate', fn_name(e));

el.oncompositionupdate = function(){ // code )};

< element oncompositionupdate="code">
// when an element is about to gain focus.
el.addEventListener('focusin', fn_name(e));

el.onfocusin = function(){ // code )};

< element onfocusin="code">
// when an element is about to lose focus
el.addEventListener('focusout', fn_name(e));

el.onfocusout = function(){ // code )};

< element onfocusout="code">
// when fullscreen changed
doc-el.addEventListener('fullscreenchange', fn_name(e));

doc-el.onfullscreenchange = function(){ // code )};
// when fullscreen error
doc-el.addEventListener('fullscreenerror', fn_name(e));

doc-el.onfullscreenerror = function(){ // code )};
click()
click()
// simulates a mouse click on an element
var x = document.getElementById('id_name');
x.click();
  
focus()
focus()
// sets focus on the specified element
var x = document.getElementById('id_name');
x.focus();
  
blur()
blur()
// removes keyboard focus from the current element
var x = document.getElementById('id_name');
x.blur();
  
getAttribute()
getAttribute()
// returns the value of a specified attribute on the element

var x = document.getElementById("some_id"); 
var y = x.getAttribute('class'); 

// "some_class_name"
getAttributeNames()
getAttributeNames()
// returns the attribute names of the element as an Array of strings

var x = document.getElementById('id_name');
var y = x.getAttributeNames();
// ["id", "class"]

getElementsByClassName()
getElementsByClassName()
// Get all elements by class
var x = document.getElementsByClassName("class_name");

// Get first element by class
var x = document.getElementsByClassName('class_name')[0]

// Get all elements of both classes
var x = document.getElementsByClassName("class_name1 class_name2");

// Get all elements inside id by class
var x = document.getElementById('id_name').getElementsByClassName('class_name');

getElementsByTagName()
getElementsByTagName()
// Get all span elements
var x = document.getElementsByTagName('span');

// Get all div elements
var x = document.getElementsByTagName('div');

// Get all div elements inside the id
var x = document.getElementById('id_name');
var x = a.getElementsByTagName('div');
closest()
closest()
// traverses the Element and its parents 
// until it finds a node that matches the provided selector string

var x = document.getElementById('id_name');
var y = x.closet('#some_id');
var y = x.closet('div > span');
var y = x.closet(':not(div)');
// HTML element

matches()
matches()
// checks to see if the Element would be selected by the provided selectorString 
// checks if the element "is" the selector.

var x = document.getElementsByTagName('div');
for (var i = 0; i < x.length; i++) {
if (x[i].matches('.class_name')) {
// code
}
}               
getBoundingClientRect()
getBoundingClientRect()
// returns the size of an element and its position relative to the viewport

var x = document.getElementById('id_name');
var y = x.getBoundingClientRect();
// DOMRect {x: 16, y: -2292, width: 1357, height: 3327.84375, top: -2292, …}

getClientRects()
getClientRects()
// returns a collection of DOMRect objects that indicate 
// the bounding rectangles for each CSS border box in a client

var x = document.getElementById('id_name');
var y = x.getClientRects();
// DOMRectList {0: DOMRect, length: 1}

hasAttribute()
hasAttribute()
// returns a Boolean value indicating whether the specified element has the specified attribute or not

var x = document.getElementById('id_name');
var y = x.hasAttribute('class');
// true

hasAttributes()
hasAttributes()
// returns a Boolean value indicating whether the specified element has the specified attribute or not

var x = document.getElementById('id_name');
var y = x.hasAttributes('class');
// true

insertAdjacentElement()
insertAdjacentElement()
// Inserts a given element node at a given position relative to the element it is invoked upon

var x = document.createElement('span');
document.body.insertAdjacentElement('afterend', x);


// beforebegin 
  el open tag
    // afterbegin 
  content
    // beforeend
  el close tag
// afterend

insertAdjacentHTML()
insertAdjacentHTML()
// Parses the text as HTML or XML and inserts the resulting nodes
//  into the tree in the position given.

document.body.insertAdjacentElement('afterend', 'HTML el as text');


// beforebegin 
  el open tag
    // afterbegin 
  content
    // beforeend
  el close tag
// afterend
insertAdjacentText()
insertAdjacentText()
// Inserts a given text node at a given position relative to the element it is invoked upon

document.body.insertAdjacentElement('afterend', 'Some text');


// beforebegin 
  el open tag
    // afterbegin 
  content
    // beforeend
  el close tag
// afterend

releasePointerCapture()
releasePointerCapture()
//  releases pointer capture that was previously set for a specific pointer

var x = document.getElementById('id_name');
x.releasePointerCapture(pointerId);
// 

hasPointerCapture()
hasPointerCapture()
// sets whether the element on which it is invoked has pointer capture 
// for the pointer identified by the given pointer ID

var x = document.getElementById('id_name');
x.hasPointerCapture(pointerId);

requestPointerLock()
requestPointerLock()
// asynchronously ask for the pointer to be locked on the given element

var x = document.getElementById('id_name');
x.requestPointerLock();
setPointerCapture()
setPointerCapture()
// Designates a specific element as the capture target of future pointer events.

var x = document.getElementById('id_name');
var y = x.setPointerCapture(pointerId);

scroll()
scroll()
// Scrolls to a particular set of coordinates inside a given element

var x = document.getElementById('id_name');
x.scroll(0, 100);

x.scroll({
  top: 100,
  left: 100,
  behavior: 'smooth'
});

// no safari support
scrollBy()
scrollBy()
// Scrolls an element by the given amount

var x = document.getElementById('id_name');
x.scrollBy({
  top: 100,
  left: 100,
  behavior: 'smooth'
});

// no safari support
scrollTo()
scrollTo()
// Scrolls to a particular set of coordinates inside a given element

var x = document.getElementById('id_name');

x.scrollTo(0, 1000);

x.scrollTo({
  top: 100,
  left: 100,
  behavior: 'smooth'
});

// no safari support
scrollIntoView()
scrollIntoView()
// Scrolls to a particular set of coordinates inside a given element

var x = document.getElementById('id_name');

x.scrollIntoView();
x.scrollIntoView(false);
x.scrollIntoView({block: "end"});
x.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"});

// alignToTop
// If true, the top of the element will be aligned to the top of the visible area
// If false, the bottom of the element will be aligned to the bottom of the visible area

// behavior 
// Defines the transition animation.
// One of auto or smooth. Defaults to auto.

// block 
// Defines vertical alignment.
// One of start, center, end, or nearest. Defaults to start.

// inline 
// Defines horizontal alignment.
// One of start, center, end, or nearest. Defaults to nearest.

setAttribute()
setAttribute()
// Sets the value of a named attribute of the current node.

var x = document.getElementById('id_name');
x.setAttribute("name", "some_name");

toggleAttribute()
toggleAttribute()
// toggles a Boolean attribute 
// removing it if it is present a
// adding it if it is not presenting

var x = document.getElementById('id_name');
var y = x.toggleAttribute('readonly');
removeAttribute()
removeAttribute()
// removes the attribute with the specified name from the element

var x = document.getElementById('id_name');
x.removeAttribute('class');;
getAnimations()
getAnimations()
var x = document.getElementById("some_id"); 
var y = x.getAnimations();

var x = document.getAnimations();
// returns an array of all Animation objects

animate()
animate()
document.getElementById("id_name").animate([
// keyframes
{ transform: 'translateY(0px)' }, 
{ transform: 'translateY(-300px)' }
], 

// timing options
{ duration: 1000, iterations: Infinity }
);

// var animation = element.animate(keyframes, options);


// keyframes
// Either an array of keyframe objects, or a keyframe object 
// whose property are arrays of values to iterate over

// options
// Either an integer representing the animation's duration (in milliseconds)
// or an Object containing one or more timing properties
// id,delay,direction,duration,easing,endDelay,fill,
// iterationStart,iterations,composite,iterationComposite            
attachShadow()
attachShadow()
// attaches a shadow DOM tree to the specified element
// returns a reference to its

var x = document.body.attachShadow({mode: 'open'});
var y = document.createElement('span');

x.appendChild(y);


// Mode : open
// Elements of the shadow root are accessible from JavaScript outside the root

// Mode : closed
// Denies access to the node(s) of a closed shadow root from JavaScript outside it

// Elements that can attach a shadow root to:

// Custom element with a valid name,article,aside,blockquote,
// body,div,footer,h1,h2,h3,h4,h5,h6,header,main,nav,p,section,span,
requestFullscreen()
requestFullscreen()
// asynchronous request to make the element be displayed in full-screen mode

var x = document.getElementById('id_name');

x.requestFullscreen().catch(err => {
// code
});

computedStyleMap()
computedStyleMap()
// returns a StylePropertyMapReadOnly interface which 
// provides a read-only representation of a CSS declaration block

var x = document.getElementById('id_name');
var y = x.computedStyleMap();
// StylePropertyMapReadOnly {size: 316}
HTML Media
audioTracks
audioTracks
//  returns an AudioTrackList object
var x = document.getElementById("video");

for (var i = 0; i < x.audioTracks.length; i += 1) {
  x.audioTracks[i].enabled = false;
}
                            
videoTracks
videoTracks
//  returns an VideoTrackList object
var x = document.getElementById("video");

for (var i = 0; i < x.videoTracks.length; i += 1) {
  x.videoTracks[i].enabled = false;
}
                            
textTracks
textTracks
//  returns an TextTrackList object
var x = document.getElementById("video");

for (var i = 0; i < x.textTracks.length; i += 1) {
  x.textTracks[i].enabled = false;
}
                            
autoplay
autoplay
// reflects the autoplay HTML attribute
var x = document.getElementById("video");

x.autoplay = false;
                            
src
src
// reflects the src HTML attribute
var x = document.createElement('video');
var y = x.src;
                            
loop
loop
// reflects the loop HTML attribute
var x = document.createElement('video');
var y = x.loop = true;
                            
defaultMuted
defaultMuted
// reflects the muted HTML attribute
var x = document.createElement('video');
x.defaultMuted = true;
                            
controls
controls
//  reflects the controls HTML attribute
var x = document.createElement('video');
x.controls = true;
                
                            
buffered
buffered
// returns ranges of the media source that the browser has buffered
var x = document.createElement('video');
var y = x.buffered // TimeRanges { length: 0 }

// read only
                            
controlsList
controlsList
//   returns a DOMTokenList to select what controls to show on the media element
var x = document.getElementById("video").controlsList;

// read only
                            
currentSrc
currentSrc
// returns source of the media
var x = document.createElement('video');
var y = x.currentSrc // "src path"

// read only
                            
currentTime
currentTime
// specifies the current playback time in seconds
// Changing the value of currentTime seeks the media to the new time
var x = document.createElement('x');
var y = x.currentTime;
                            
disableRemotePlayback
disableRemotePlayback
// determines whether the media element is allowed to have a remote playback UI
var x = document.createElement('audio');
x.disableRemotePlayback = true;
                            
error
error
// is the MediaError object for the most recent error
var x = document.createElement('video');
var y = x.error;

// read only
                            
paused
paused
// indicates whether the media element is paused
var x = document.createElement('video');
var y = x.paused;
                            
muted
muted
// indicates whether the media element muted
var x = document.createElement('video');
var y = x.muted;
                            
ended
ended
// indicates whether the media element has ended playback
var x = document.createElement('video');
var y = x.ended;

// read only
                            
defaultPlaybackRate
defaultPlaybackRate
// indicates the default playback rate for the media
var x = document.createElement('video');
var y = x.defaultPlaybackRate;
                            
playbackRate
playbackRate
// indicates the rate at which the media is being played back
// set controls for fast forward, slow motion
var x = document.createElement('video');
var y = x.playbackRate; 
                            
duration
duration
// indicates the length of the element's media in seconds
var x = document.createElement('video');
var y = x.duration;

// read only
                            
networkState
networkState
// indicates the current state of the fetching of media over the network
var x = document.getElementById('video');

x.addEventListener('playing', function() {

  if (x.networkState === 2) {
    // Still loading...
  }

});

// read only 

// NETWORK_EMPTY	0 
// There is no data yet. Also, readyState is HAVE_NOTHING.

// NETWORK_IDLE	1 
// HTMLMediaElement is active and has selected a resource, but is not using the network.

// NETWORK_LOADING	2 
// The browser is downloading HTMLMediaElement data.

// NETWORK_NO_SOURCE	3 
// No HTMLMediaElement src found.
                
                            
readyState
readyState
// indicates the readiness state of the media
var x = document.getElementById('video');

x.addEventListener('loadeddata', function() {

  if(x.readyState >= 2) {
    x.play();
  }

});

// read only

// HAVE_NOTHING	0 
// No information is available about the media resource.

// HAVE_METADATA	1	
// Enough of the media resource has been retrieved that the metadata attributes are initialized. Seeking will no longer raise an exception.

// HAVE_CURRENT_DATA	2	
// Data is available for the current playback position, but not enough to actually play more than one frame.

// HAVE_FUTURE_DATA	3 
// Data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).

// HAVE_ENOUGH_DATA	4 
// Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.
            
seekable
seekable
//  returns a TimeRanges object that contains the time ranges that the user is able to seek to
var x = document.getElementById('video');
var y = x.seekable

// read only
                            
volume
volume
// sets the volume at which the media will be played
// 0 to 1
var x = document.getElementById("video");
x.volume = 1;
                            
canPlayType()
canPlayType()
// reports how likely it is that the current browser will be able to play media of a given MIME type
var x = document.createElement('video');
var y = x.canPlayType('video/mp4') 

// "probably" or "maybe" or ""
                
                            
load()
load()
// resets to its initial state 
// begins selecting the source 
// loading for playback to begin at the beginning

var x = document.getElementById("video");
x.load();
                
                                    
play()
play()
// start the playback

var x = document.getElementById("video");
x.play();
                
                                    
pause()
pause()
// pause the playback

var x = document.getElementById("video");
x.pause();
                
                                    
Event
bubbles
bubbles
// A boolean indicating whether or not the event bubbles up through the DOM

function fn_name(e) {
    var x = e.bubbles;
    // true
}

// read only 
                    
cancelable
cancelable
// A boolean indicating whether the event is cancelable.

function fn_name(e) {
    var x = e.cancelable;
    // true
}

// read only 
                    
composed
composed
// A boolean indicating whether or not the event can bubble 
// across the boundary between the shadow DOM and the regular DOM

function fn_name(e) {
    var x = e.composed ;
    // true
}

// read only 
                    
currentTarget
currentTarget
// current target for the event
// It always refers to the element to which the event handler has been attached
// Event.target, which identifies the element on which the event occurred and which may be its descendant
function fn_name(e) {
    var x = e.currentTarget;
}

                    
cancelBubble
cancelBubble
// Setting its value to true before returning from an event handler prevents propagation of the event

function fn_name(e) {
   e.cancelBubble = true;
}
                    
defaultPrevented
defaultPrevented
// Indicates whether or not the call to event.preventDefault() canceled the event

function fn_name(e) {
    var x = e.defaultPrevented;
    // true
}

// read only 
                    
eventPhase
eventPhase
// Indicates which phase of the event flow is being processed

function fn_name(e) {
    var x = e.eventPhase;
    // true
}

// read only 

// Event.NONE	0	
// No event is being processed at this time.

// Event.CAPTURING_PHASE	1	
// The event is being propagated through the target's ancestor objects.

// Event.AT_TARGET	2	
// The event has arrived at the event's target.

// Event.BUBBLING_PHASE	3	
// The event is propagating back up through the target's ancestors in reverse order, starting with the parent, and eventually reaching the containing Window.
                    
returnValue
returnValue
// indicates whether the default action for this event has been prevented or not

function fn_name(e) {
    var x = e.returnValue;
    // true
}

// read only 
                    
target
target
// A reference to the target to which the event was originally dispatched

function fn_name(e) {
    var x = e.target;
}

// read only 
                    
timeStamp
timeStamp
// returns the time (in milliseconds) at which the event was created

function fn_name(e) {
    var x = e.timeStamp;
}

// read only 
                    
type
type
// The name of the event. Case-insensitive

function fn_name(e) {
    var x = e.type;
}

// read only 
                    
isTrusted
isTrusted
// a Boolean that is true when the event was generated by a user action, 
// false when the event was created 
// false when modified by a script 
// false when dispatched via EventTarget.dispatchEvent()

function fn_name(e) {
    var x = e.isTrusted;
    // true
}

// read only 
                    
composedPath()
composedPath()
// returns the event’s path which is an array of the objects on which listeners will be invoked

function fn_name(e) {
    var x = e.composedPath();
}
                    
preventDefault()
preventDefault()
// Cancels the event (if it is cancelable)

function fn_name(e) {
  e.preventDefault();
}
                    
stopImmediatePropagation()
stopImmediatePropagation()
// For this particular event, prevent all other listeners from being called

function fn_name(e) {
  e.stopImmediatePropagation();
}
                    
stopPropagation()
stopPropagation()
// Stops the propagation of events further along in the DOM

function fn_name(e) {
  e.stopPropagation();
}
                    
addEventListener()
addEventListener()
// sets up a function that will be called whenever the specified event is delivered to the target

document.addEventListener('event_name', fn_name(e));
window.addEventListener('event_name', fn_name(e));
el.addEventListener('event_name', fn_name(e));


// target.addEventListener(type, listener [, options]);
// target.addEventListener(type, listener [, useCapture]);

// type
// A case-sensitive string representing the event type to listen for

// listener
// The function object that receives a notification when an event of the specified type occurs

// options
// capture,once,passive

// useCapture
// A Boolean indicating whether events of this type will be dispatched 
// to the registered listener before being dispatched to any EventTarget 
// beneath it in the DOM tree
                
removeEventListener()
removeEventListener()
// removes from the EventTarget an event listener previously registered
// The event listener to be removed is identified using a combination of the event type,
// the event listener function itself, 
// various optional options that may affect the matching process

document.removeEventListener('event_name', fn_name(e));
window.removeEventListener('event_name', fn_name(e));
el.removeEventListener('event_name', fn_name(e));
                
dispatchEvent()
dispatchEvent()
// Dispatches an Event at the specified EventTarget, (synchronously) 
// invoking the affected EventListeners in the appropriate order

var x  = !target.dispatchEvent(event)