Skip to content

Instantly share code, notes, and snippets.

@wildskyf
Last active May 31, 2016 12:44
Show Gist options
  • Save wildskyf/a19aa36f09aafb265f81 to your computer and use it in GitHub Desktop.
Save wildskyf/a19aa36f09aafb265f81 to your computer and use it in GitHub Desktop.
Toolbox
var isEmptyObj = (obj) => !Object.keys(obj).length;
var cloneJson = (a) => JSON.parse(JSON.stringify(a))
var isArray(a) => Object.prototype.toString.call(a) === '[object Array]'
Array.prototype.unique = () => this.join(",").match(/([^,]+)(?!.*\1)/ig);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment