- 首先,我们用java封装一个简单的中文数学函数。
<>
;(function(温逗死){
温逗死.中文 = {
加法:function(o){return o.reduce(function(a,b){return a + b});},
减法:function(o){return o.reduce(function(a,b){return a - b});},
乘法:function(o){return o.reduce(function(a,b){return a * b});},
除法:function(o){return o.reduce(function(a,b){return a / b});},
取余:function(o){return o.reduce(function(a,b){return a % b});},
警报:function(o){alert(o);}
}
})(window)
</>
2.然后,我们写一个html文件GPT改写。
<!doctype html>
<html>
<head>
<title>js中文编程数学函数</title>
<meta charset="utf8" />
</head>
<body>
<>
中文.警报(中文.加法([1,2,3,4,5,6,7,8,9]));
</>
</body>
</html>
3.最后,看弹出来什么。