In JavaScript, arrays can be sorted using methods like sort(), which sorts the elements alphabetically by default, and can take a custom comparison function for sorting elements in non-standard ways. Another method is the reverse() function which reverses the order of the elements in an array. Furthermore, the concat() method can be employed to merge two or more arrays.
for (let i = 0; i < array.length; i++) {
// perform actions with array[i]
}
array.forEach(function(element) {
// perform actions with element
});
let newArray = array.map(function(element) {
return /*return the new value for the new array*/;
});
let filteredArray = array.filter(function(element) {
return /*return true or false for filtering*/;
});
let result = array.reduce(function(accumulator, currentValue) {
return /*return the new accumulator value*/;
}, initialValue);