@ganuz/each
v0.1.1
Published
Each is package from Ganuz library
Downloads
7
Maintainers
Readme
@ganuz/each
Each is package from Ganuz library
Install
$ yarn add @ganuz/each
Or
$ npm install --save @ganuz/each
Use
Module
import {
default as each
} from '@ganuz/each';
Browser
<script src="https://unpkg.com/@ganuz/each/bundle.umd.min.js"></script>
let {
each
} = G;
Examples
let target = Object.create({num: 55}, {
name: {value: 'alice', writable: true},
foo: {get(){ return 'bar'; },
[Symbol('color')]: {value: 'red'}
};
each(target, (value, key, object) => console.log(`object['${key}'] = ${object[key]};`) === target;
// => 'object['name'] = 'alice';'
// => 'object['foo'] = 'bar';'
// => 'object['Symbol(color)'] = 'red';'
// => true
let array = [6, -1, NaN, 88, 0.5];
each(array, (value) => value === value && console.log(value)) === array;
// => 6
// => -1
// => true
License
Copyright © Yisrael Eliev, Licensed under the MIT license.