0.1.3 • Published 6 years ago
string-from v0.1.3
string-from
NOTE: string-from was renamed to @extra-string/from.
Create string from iterable, like Array.from()
.
const from = require('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'