UNPKG
11.calculator
Version:
latest (1.0.1)
1.0.1
自定义简单计算器模板
github.com/zhan1218/calculator
zhan1218/calculator
11.calculator
/
lib
/
calculator.js
17 lines
•
260 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const
add
=(
x,y
)=>{
return
x+y }
const
sub
=(
x,y
)=>{
return
x-y }
const
cheng
=(
x,y
)=>{
return
x*y }
const
chu
=(
x,y
)=>{
return
x/y }
// 导出的就是一个函数
exports
.
add
=add
exports
.
sub
=sub
exports
.
cheng
=cheng
exports
.
chu
=chu