-
Notifications
You must be signed in to change notification settings - Fork 1
from
Subhajit Sahu edited this page May 5, 2020
·
1 revision
Create string from iterable, like Array.from()
.
const from = require('@extra-string/from');
// from(<iterable>, [mapFn], [thisArg])
from(['a', 'b']);
// 'ab'
from('abc', (v) => String.fromCharCode(v.charCodeAt()+1));
// 'bcd'
from(new Set().add('a').add('b'));
// 'ab'
from(new Map().set('a', 1).set('b', 2));
// 'a,1b,2'