使用npm包 back-calculation
拓展包源码地址:https://github.com/zhangjiahao93/back-calculation
demo地址: http://zjh.cool/sum/
demo源码地址:https://github.com/zhangjiahao93/back-calculation-demo
欢迎star
安装 back-calculation 包
yarn add back-calculation
# or
npm install back-calculation
使用方法
import BC from "back-calculation"; const obj = new BC({ input: [1, 2, 3, 4, 5, 6, 7, 8, 9], sum: 20, }); obj.getValues();