JQuery | makeArray() Method Last Updated : 29 Apr, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report This makeArray() method in jQuery is used to convert an array-like object into a true JavaScript array. Syntax: jQuery.makeArray( obj ) Parameters: This method accept a single parameter which is mentioned above and described below: obj : This parameter holds an object to turn into a native Array. Return Value: It returns the array. Below examples illustrate the use of makeArray() method in jQuery: Example 1: This example use jQuery.makeArray() method and turn a collection of HTMLElements into an Array of them. html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JQuery | makeArray() method</title> <script src= "https://code.jquery.com/jquery-3.4.1.js"> </script> </head> <body style="text-align:center;"> <h1 style="color: green"> GeeksforGeeks </h1> <h3>JQuery | makeArray () method</h3> <p>Geeks1</p> <p>Geeks2</p> <p>Geeks3</p> <button onclick="geek()">Click</button> <br> <br> <b id="root"></b> <script> function geek() { var elems = document.getElementsByTagName("p"); var x = jQuery.makeArray(elems); var t = x[1]; x[1] = x[2]; x[2] = t; $(x).appendTo(document.body); } </script> </body> </html> Output: Example 2: This example use jQuery.makeArray() method and convert an array-like string into the actual array. html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JQuery | makeArray() method</title> <script src= "https://code.jquery.com/jquery-3.4.1.js"> </script> </head> <body style="text-align:center;"> <h1 style="color: green"> GeeksforGeeks </h1> <h3>JQuery | makeArray() method</h3> <b>String = "[2, 5, 6, 3, 8, 9]"</b> <br> <br> <button onclick="geek()">Click</button> <br> <br> <b id="root"></b> <script> function geek() { var el = document.getElementById('root'); var arr = "[2, 5, 6, 3, 8, 9]"; var newArr = jQuery.makeArray(arr) el.innerHTML = jQuery.type(newArr) + " = " + newArr; } </script> </body> </html> Output: Comment More infoAdvertise with us Next Article JQuery | isArray() method S SHUBHAMSINGH10 Follow Improve Article Tags : JQuery jQuery-Methods Similar Reads JQuery map() Method This map() Method in jQuery is used to translate all items in an array or object to a new array of items. Syntax: jQuery.map( array/object, callback )Parameters: This method accepts two parameters which are mentioned above and described below: array/object: This parameter holds the Array or object t 2 min read JQuery | isArray() method This isArray() Method in jQuery is used to determines whether the argument is an array. Syntax: jQuery.isArray( object ) Parameters: The isArray() method accepts only one parameter that is mentioned above and described below: object : This parameter is the object to test whether or not it is an arra 2 min read jQuery inArray() method This inArray() Method in jQuery is used to search for a specific value in an array and return its index (or -1 if not found). SyntaxjQuery.inArray(val, arr [, Index])Parameters The inArray() method accepts three parameters that are described below: val: The value to search in an array.arr: Any array 1 min read jQuery | Misc toArray() Method The toArray() Method in jQuery is used to return the elements that are matched by the jQuery selector as an array. Syntax $(selector).toArray() Parameters: This method does not accept any parameters. Example 1: This method uses toArray() method to display the paragraph in form of array. html <!DO 2 min read What's the difference between toArray and makeArray in jQuery ? In this article, we will learn the difference between the toArray() and makeArray() methods in jQuery. JavaScript toArray() method: This method is used on DOM (Document Object Model) elements to convert them into a JavaScript array. We can iterate this array, calculate its length, and access the ele 3 min read How to use array with jQuery ? An array is a linear data structure. In JavaScript, arrays are mutable lists with a few built-in methods, we can define arrays using the array literal. The arrays can be used in the same way in jQuery as used in JavaScript. Syntax And Declaration:let arr1=[];let arr2=[1,2,3];let arr2=["India","usa", 1 min read Like