There is no obvious difference between an arrow function and a regular function.
({}).toString.call(function () {})
\"[object Function]\"
({}).toString.call(
Uhm, the requirements are a bit weird, but I made some tests and:
typeof (() => {}).prototype === "undefined"
Is true
, while:
typeof (function () {}).prototype === "undefined"
Is false
, so:
function isArrow(x)
{
return typeof (x.prototype) === "undefined"
}
Fiddle here: https://jsfiddle.net/87kn67ov/