JavaScript函数零散知识点_new function return 1 2-CSDN博客

网站介绍:函数声明的三种方式var fun = new Function("return 1+2");console.log(fun()); // 输出3// 第二种方式 (函数声明)function fun2() { return 2 + 3;}console.log(fun2());// 输出5// 第三种函数 (表达式方式声明函数)var fun3 = function(){ return 4 + 5;}console.log(fun3()); // 输出9函数的实参_new function return 1 2