Is there an elegant way to tell Harmony\'s slim arrow functions apart from regular functions and built-in functions?
The Harmony wiki states that:>
Ron S's solution works great but can detect false positives:
/** Check if function is Arrow Function */
const isArrowFn = (fn) => (typeof fn === 'function') && /^[^{]+?=>/.test(fn.toString());
/* False positive */
const fn = function (callback = () => null) { return 'foo' }
console.log(
isArrowFn(fn) // true
)