JavaScript isArray() Function

What is isArray() function in Javascript ? The isArray() is a predefined function of javascript. It is used for checking wheater the input value is string or not. Syntax: Array.isArray(object) Explanation: An object parameter is a required field of function. Example 1 var social = [“facebook”,”Whatsapp”,”Instagram”]; console.log(Array.isArray(social)); Explanation: We first declare one array in variable […]

JavaScript insertBefore() Method

Sometimes we need to insert an element at a specific position, or we need to insert an element before any particular element. At that time we can use JavaScript insert before method. JavaScript insertBefore() method inserts a node at the specified position between HTML DOM elements. Also Read: JavaScript appendChild() Method Example Let’s consider we […]

JavaScript appendChild() Method

JavaScript appendChild() method appends the new HTML node as the last child of another HTML node. This method is used with JavaScript createElement() method. So if you don’t know how to use createElement() method in JavaScript Please read JavaScript createElement() method. Example 1 If we have a list in HTML and we want to add […]