Skip to content

Instantly share code, notes, and snippets.

@boopathi
Last active August 29, 2015 14:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boopathi/7c4adc4f4790f432838d to your computer and use it in GitHub Desktop.
Save boopathi/7c4adc4f4790f432838d to your computer and use it in GitHub Desktop.
Differentiate between an arrow function, class, method, generator and a normal function in ES6
@bergus
Copy link

bergus commented Aug 14, 2015

This should fail for () => (function(){}). Try /^\s*function/.test(fn).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment