Pretty self explanatory, is there a way to check, in code, the difference between an arrow function an a regular one?
Explaining myself:
I have an array of functions coming in, most are simple arrow functions that return an object, but the rest are regular functions, used as constructors. Is there a way to check whether a function is an arrow or not without being horribly inefficient with pak.map(el => {try {el.unpak = new el.fn} catch(e) {el.unpak = el.fn()}}
)? The try/catch is an idea I came up with that works, but is horridly slow (since only a handful of functions are actually constructors in this array) and really refuse to use that in any production scenario. Does anyone have any ideas to this?