方法返回一个表示当前函数源代码的字符串。
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());
原文:https://www.cnblogs.com/blogZhao/p/12559629.html