Function.prototype.toString()
方法返回一个表示当前函数源代码的字符串。
function sum(a, b) {
return a + b;
}
console.log(sum.toString());
// expected output: "function sum(a, b) {
// return a + b;
// }"
// expected output: "function abs() { [native code] }"
console.log(Math.abs.toString());
浙公网安备 33010602011771号