Sort an array of objects in JavaScript dynamically. Learn how to use Array.prototype.sort() and a custom compare function, and avoid the need for a library.
Tag: array methods
Aurelio introduces ES6 methods that work with arrays — Array.* and Array.prototype.* — showing examples of them in action and listing available polyfills.
M. David Green uses filtering to limit a data set & chaining to combine the results with map/reduce. The result—clean code that performs complex operations.
M. David Green demonstrates how using the functional programming techniques of mapping & reducing can lead to cleaner code which is easy to read & maintain.
Learn how to create arrays in JavaScript, and how to manipulate them using their length property.
Martín Martínez introduces you to Underscore.js and details how you can use it to write cleaner code which is both easier to read and easier to maintain.
Edwin Reynoso introduces NodeList.js, a tiny library he wrote to make DOM manipulation with plain JS suck less and to rid people of their jQuery dependency.