You can use Function.toString() to return a string representation of the function source code, then find the arrow ( => ) in the line.
var arrowFunc = x => 2 * x var regFunc = function (x) {return 2 * x} arrowFunc.toString().indexOf("=>")
source share