- Mastering Immutable.js
- Adam Boduch
- 71字
- 2021-07-08 10:30:06
Lists
A list is like a JavaScript array. It's an indexed collection, meaning that the same type of indexes that you would use with an array will also work with lists. The notation is different, though—you use methods to get and set data instead of the [] notation, as shown here:
import { List } from 'immutable';
const myList = List();
console.log('List', myList instanceof List);
// -> List true