JQuery > 创建方法(函数)方法
作者:互联网
创建函数,方式一
var fun1 = new Function("a", "b", "alert(a);")
fun1(1, 2);
这种方式用的及其的少
创建函数,方式二
var fun2 = function(a,b){
document.write("Result is (sum) :" + (a+b))
}
fun2(2,3);
创建函数,方式三
function fun3(a,b){
console.log("Result is (sum) :" + (a+b));
}
fun3(3,4);
标签:JQuery,function,fun1,函数,fun3,fun2,创建,方法 来源: https://blog.csdn.net/weixin_43309893/article/details/120174042