封装函数返回给定两数的和跟差
function getSum(x, y) { let jia = x + y let jian = x - y return [jia, jian] } let sum = getSum(1, 2) document.write(`和是:${[sum[0]]}差是:${sum[1]}`) document.write('和是' + sum[0] + '差是' + sum[1])