Skip to content

Instantly share code, notes, and snippets.

View shape-of-myHeart's full-sized avatar

shape-of-myHeart

View GitHub Profile
@shape-of-myHeart
shape-of-myHeart / keyMap.js
Created August 17, 2017 16:53
object map function
let keyMap = obj => (callback, formatter) => {
let keys = Object.keys(obj),
result = [];
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
result[typeof formatter === 'function' ? formatter(key) : i] = callback(obj[key], key);
}
return result;
const { Vector2, isVector2 } = (
() => {
class _Vector2 {
constructor(x, y) {
let data = {
x: x || 0,
y: y || 0
};
const checkParmeterType = parameters => {