dist/chirashi.common.js
function forIn(object, callback) {
  if ((typeof object === 'undefined' ? 'undefined' : _typeof(object)) !== 'object') return;

  forEach(Object.keys(object), _forKey.bind(null, object, callback));

  return object;
}
function forIn(object, callback) {
  if ((typeof object === 'undefined' ? 'undefined' : _typeof(object)) !== 'object') return;

  forEach(Object.keys(object), _forKey.bind(null, object, callback));

  return object;
}
function forIn ( object , callback ) { if ( ( typeof object === 'undefined' ? 'undefined' : _typeof ( object ) ) !== 'object' ) return ; forEach ( Object . keys ( object ) , _forKey . bind ( null , object , callback ) ) ; return object ; }
Callback to apply on element.
@callback forElementsCallback
@param {Window | document | HTMLElement | SVGElement | Text} element
@param {number} index - Index of element in elements.
 
Iterates over object's keys and apply callback on each one.
@param {Object} object - The iterable.
@param {forInCallback} callback - The function to call for each key-value pair.
@return {Object} object - The iterable for chaining.
@example //esnext
import { forIn } from 'chirashi'
const californiaRoll = { name: 'California Roll', price: 4.25, recipe: ['avocado', 'cucumber', 'crab', 'mayonnaise', 'sushi rice', 'seaweed'] }
forIn(californiaRoll, (key, value) => {
console.log(`${key} -> ${value}`)
}) //returns: { name: 'California Roll', price: 4.25, recipe: ['avocado', 'cucumber', 'crab', 'mayonnaise', 'sushi rice', 'seaweed'] }
// LOGS:
// name -> California Roll
// price -> 4.25
// recipe -> ['avocado', 'cucumber', 'crab', 'mayonnaise', 'sushi rice', 'seaweed']
@example //es5
var californiaRoll = { name: 'California Roll', price: 4.25, recipe: ['avocado', 'cucumber', 'crab', 'mayonnaise', 'sushi rice', 'seaweed'] }
Chirashi.forIn(californiaRoll, (key, value) => {
console.log(key + ' -> ' + value)
}) //returns: { name: 'California Roll', price: 4.25, recipe: ['avocado', 'cucumber', 'crab', 'mayonnaise', 'sushi rice', 'seaweed'] }
// LOGS:
// name -> California Roll
// price -> 4.25
// recipe -> ['avocado', 'cucumber', 'crab', 'mayonnaise', 'sushi rice', 'seaweed']
Callback to apply on element .