const difference = (a1, a2) => a1.filter(x => a2.indexOf(x) == -1)
Creates array with 1...N elements
[...Array(10).keys()]
//→ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[...document.querySelectorAll('div')]
const merge = (...xs) => Object.assign({}, ...xs)
const limit = (value, min, max) => Math.min(Math.max(value, min), max)
const x = require('xtend')
const mapObject = (obj, cb) => {
return x(...Object.keys(obj).map(k => {
const newObj = {}
newObj[k] = cb(obj[k])
return newObj
}))
}