List of JavaScript array methods and propertiesWhat is JavaScript?
1. constructor The constructor returns the function that created the Array object’s prototype. Example: <script> const countries = [“Pakistan”, “Canada”, “USA”, “China”]; var text = countries.constructor; // text variable will returns like: function Array() { [native code] } </script> 2. concat() The concat() method is used to join (concatenates) two or more arrays and return an array with the joined arrays. Example: <script> const arr1 = [“Jhon”, “Lee”]; const arr2 = [“Emma”, “Tessa”, “Anna”]; const arr3 = arr1.concat(arr2); // arr3 variable will returns e.g: Jhon,Lee,Emma,Tessa,Anna </script> 3. valueOf() The valueOf() method returns the primitive value of an array. Example: <script>…
Read MoreJavaScript is a programming or scripting language. JavaScript is one of the core technologies of the WWW, alongside HTML and CSS. JavaScript was developed in 1965 by “Brendan Eich”. Advantages & Disadvantages of JavaScript: Every programming language has some advantages and disadvantages; like other programming languages, JavaScript has some advantages and disadvantages. Advantages of JavaScript: We will discuss the advantages of using JavaScript language. Speed: JavaScript is an interpreted programming language. JavaScript is a client-side scripting language. Simplicity: JavaScript is very easy to understand and learn as compared to other programing languages. Popularity: JavaScript has a lot of popularity, it…
Read More