js remove "" code example

Example 1: remove javascript

var elem = document.getElementById("myDiv");
elem.parentNode.removeChild(elem);

Example 2: Js remove

var ar = [1, 2, 3, 4, 5, 6];
    
    ar.pop(); // returns 6
    console.log( ar ); // [1, 2, 3, 4, 5]
    
    ar.shift(); // returns 1
    console.log( ar ); // [2, 3, 4, 5, 6]
    
    
    for ( var i = 0; i < ar.length; i++){
    	if (ar[i] === 2 /*Value u wont to remove*/)
          ar.splice(i, 1);
    }
	console.log( ar ); // [1, 3, 4, 5, 6]

Example 3: .remove javascript

<div id="div-01">Here is div-01</div>
<div id="div-02">Here is div-02</div>
<div id="div-03">Here is div-03</div>