Skip to content

Instantly share code, notes, and snippets.

View avchugaev's full-sized avatar
🏠
Working from home

Alex Chugaev avchugaev

🏠
Working from home
View GitHub Profile
import {ReadOnlyList, ArrayList} from '@monument/core';
const vegetables: ReadOnlyList<string> = new ArrayList(['potato', 'tomato', 'cucumber']);
vegetables.getAt(0); // "potato"
vegetables.indexOf('cucumber'); // 2
vegetables.contains('cucumber'); // true
vegetables.containsAll(['cucumber', 'tomato']); // true
import {List, LinkedList} from '@monument/core';
const fruits: List<string> = new LinkedList();
fruits.add('lime'); // true
fruits.addAll(['apple', 'orange', 'banana']); // true
fruits.remove('apple'); // true
fruits.removeAll(['lime', 'orange']); // true
fruits.clear(); // true
import {List, ArrayList} from '@monument/core';
const vegetables: List<string> = new ArrayList(['potato', 'tomato', 'cucumber']);
vegetables.getAt(0); // "potato"
vegetables.setAt(0, 'carrot'); // "potato"
vegetables.indexOf('cucumber'); // 2
vegetables.contains('cucumber'); // true
vegetables.containsAll(['cucumber', 'tomato']); // true
vegetables.insert(0, 'potato'); // true