You can use jQuery.map, which is the way to go if you have the jQuery Library already loaded.
$.map( [1, 2, [3, 4], [5, 6], 7], function(n){
return n;
});
Returns
[1, 2, 3, 4, 5, 6, 7]
More Related Contents:
- Sorting array of object based on range of Numbers of String [closed]
- How to find the sum of an array of numbers
- Converting JavaScript object with numeric keys into array
- JQuery .each() backwards
- Why does typeof array with objects return “object” and not “array”? [duplicate]
- Finding matches between multiple JavaScript Arrays
- How to add an object to an array
- Check if an array is empty or exists
- Filter array of objects with another array of objects
- Find and remove objects in an array based on a key value in JavaScript
- How to count the number of occurrences of each item in an array? [duplicate]
- Using jQuery to compare two arrays of Javascript objects
- Get unique results from JSON array using jQuery
- Compare 2 arrays which returns difference
- How to Compare two Arrays are Equal using Javascript? [duplicate]
- What is the most efficient way to sort an Html Select’s Options by value, while preserving the currently selected item?
- Javascript algorithm to find elements in array that are not in another array
- Filter strings in Array based on content (filter search value)
- What does $(selector)[0] mean in jQuery?
- jQuery min/max property from array of elements
- remove item from array using its name / value
- Get largest value in multi-dimensional array javascript or coffeescript
- Remove occurrences of duplicate words in a string
- Can I append an array to ‘formdata’ in javascript?
- How to set DOM element as first child?
- Create array of all integers between two numbers, inclusive, in Javascript/jQuery
- Sorting an Array of JavaScript Objects a Specific Order (using existing function)
- Flatten a javascript object to pass as querystring
- javaScript: Can a comma occur after the last set of values in an array?
- Getting max value(s) in JSON array