There are two ways to create sequences: you can directly create sequence instances, passing them collection data, or you can transform existing collections, such as lists and maps, into sequences.
Sequence creation and iteration
Basic sequence creation
You can create new sequences by passing the Seq() constructor JavaScript arrays or objects, as follows:
import { Seq } from 'immutable';
const myIndexedSeq = Seq([1, 2, 3]);
const myKeyedSeq = Seq({ one: 1, two: 2, three: 3 });
console.log('myIndexedSeq', myIndexedSeq.toJS());
// -> myIndexedSeq [ 1, 2, 3 ]
console.log('myKeyedSeq', myKeyedSeq.toJS());
// -> myKeyedSeq { one: 1, two: 2, three: 3 }
There are actually two types of sequence collections...