Created
November 7, 2018 10:51
-
-
Save adalberth/85ea4598a3b277bccd53679f800d98a2 to your computer and use it in GitHub Desktop.
Utils functions - just nice to have around
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
css(element, { | |
backgroundColor: 'red', | |
}) | |
*/ | |
export function css (el, styles) { | |
for (var style in styles) { | |
el.style[style] = styles[style] | |
} | |
} | |
/* | |
fl(n, i => { | |
// do something | |
}) | |
*/ | |
export function fl(length, callback) { | |
for (let i = 0; i < length; i++) { | |
callback(i) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment