Operations for a dynamic List data structure.
Lists
Insert Values
Get Values
Update List
Search + Compare
Examples in
JavaScript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.sort();
console.log(fruits);
fruits.reverse(); // Then reverse the order of the elements
console.log(fruits);
// Custom sort
var complexList = [{prop: 1}, {prop:100}, {prop:23}];
complexList.sort(function(a, b){return a.prop - b.prop});
console.log(complexList);
console.log([1, 2, 3].includes(2));
console.log([1, 2, 3].includes(4));
console.log(['some', 'simple', 'words'].includes(123));
console.log(['some', 'simple', 'words'].includes('words'));