Maps to sequences

We can convert maps to sequences using toSeq():

const myMap = Map.of(
'one', 1,
'two', 2,
'three', 3
);
const myKeyedSeq = myMap.toSeq();

console.log('myKeyedSeq', myKeyedSeq.toJS());
// -> myKeyedSeq { one: 1, two: 2, three: 3 }
These examples aim to illustrate that sequences are simply a representation of the original collection. It's not often that you'll store sequences in constants like this. In fact, there are several places in this book where we store constants unnecessarily. This is done simply as an effort to make the code more teachable.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.38.125