const list = new List();list.add(3);list.addAtHead(0);list.remove(4);list.set(1, 127);list.contains(1);for(let i = 0; i < list.size(); i++){ console.log(list.get(i));});let array = ['dog', 'cat', 'bird'];let also = new Array(5);
Adding Element
array[3] = 'statistics';
Setting Value
array[3] = 'whale';
Deleting Element
delete array[4];
Looping
array.forEach({...});
Checking if a value is included
array.includes('dog');`let linkedList = new LinkedList();linkedList.append(2);linkedList.prepend(6);linkedList.addAt(2, 5);linkedList.fetchHead();linkedList.getAt(5);linkedList.removeAt(4);linkedList.delete(9);linkedList.contains(4);for (const e of linkedList) {...}let sortedSet = new SortedSet();sortedSet.add(5);sortedSet.delete(2);sortedSet.has(3);for(element in sortedSet.toArray) { console.log(element);});let dict = new Dictionary();dict.add('age', 18);dict.set('height', 183);dict.remove('height');dict.hasKey('fage');dict.hasValue(18);let hashset = new HashSet();hashset.add(3);hashset.delete(2);hashset.has(3);let keys = hashset.values();for(let i = 0; i < keys.length; i++){ console.log(keys[i]);});No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.