jQuery | Misc toArray() Method Last Updated : 27 Feb, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 <!DOCTYPE html> <html> <head> <title> jQuery Misc toArray() Method </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> </head> <body style="text-align:center;"> <h1 style = "color:green;" > GeeksForGeeks </h1> <h2>jQuery Misc toArray() Method</h2> <button>Click</button> <p>Geeks1</p> <p>Geeks2</p> <p>Geeks3</p> <!-- Script to use toArray() method --> <script> $(document).ready(function() { $("button").click(function() { var i; var x = $("p").toArray() for (i = 0; i< x.length; i++) { alert(x[i].innerHTML); } }); }); </script> </body> </html> Output: Before Click on the button: After Click on the button: Example 2: This example use toArray() method to display the array element. html <!DOCTYPE html> <html> <head> <title> jQuery Misc toArray() Method </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> </head> <body style="text-align:center"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>jQuery Misc toArray() Method</h2> <button>Click</button> <p>Geeks1-Geeks2-Geeks3</p> <div style="color:lightgreen;"></div> <!-- This example use toArray() method --> <script> $(document).ready(function(){ $("button").click(function(){ var i; var x = $("p").toArray() for (i = 0; i< x.length; i++) { $("div").text(x[i].innerHTML); } }); }); </script> </body> </html> Output: Before Click on the button: After Click on the button: Comment More infoAdvertise with us Next Article Lodash _.toArray() Method S SHUBHAMSINGH10 Follow Improve Article Tags : Web Technologies JQuery jQuery-Misc Similar Reads jQuery | Misc param() Method The param() method in jQuery is used to create a representation of an array or an object. This representation is created in a serialized way. This serialized values can be used in making an ajax request in URL. Syntax: $.param(object, trad) Parameter: object: Specifies an array or object to serializ 1 min read Lodash _.toArray() Method Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. The _.toArray() method is used to convert the given value to an array. Syntax: _.toArray( value ) Parameters: This method accepts a single parameter as mentione 1 min read Collect.js toArray() Method The toArray() method is used to convert the given collection into a normal array. An array containing the values will be returned if the collection is an object. Syntax: collect(array).toArray() Parameters: The collect() method takes one argument that is converted into the collection and the toArray 1 min read JavaScript typedArray.set() Method The typedArray.set() is an inbuilt function in JavaScript which is used to stores a number of values in the given typedArray. typedArray.set(typedArray, offset) Parameters: It accept two parameters which are specified below- typedarray: It is the source array. offset: It is optional and it is into t 1 min read Ember.js MutableArray toArray() Method Ember.js is an open-source JavaScript framework used for developing large client-side web applications which is based on Model-View-Controller (MVC) architecture. Ember.js is one of the most widely used front-end application frameworks. It is made to speed up development and increase productivity. C 5 min read Ember.js EmberArray toArray() Method Ember.js is an open-source JavaScript framework used for developing large client-side web applications which is based on Model-View-Controller (MVC) architecture. Ember.js is one of the most widely used front-end application frameworks. It is made to speed up development and increase productivity. C 5 min read Like