简洁写法
function bigSum(a,b){
if(typeof(a) !== 'string' || typeof(b) !== 'string'){
console.log('参数为字符串类型')
}
let res = '' , c = 0
const arra = a.split('')
const arrb = b.split('')
let time = 20
while(arra.length || arrb.length || c && time > 0){
time--
c = ~~arra.pop() + ~~arrb.pop() + c
res = c%10 + res
c = c > 9 ? 1 : 0
}
return res
}
console.log(bigSum('11111111111111111','11111111111111111')) //22222222222222222
console.log(11111111111111111+11111111111111111) //22222222222222224