calc-me
v0.0.2
Published
Calculate a set of operations over a var
Downloads
4
Readme
calc-me
Calculate a set of operations over a var
#Usage
npm install --save calc-me
API
import calc from 'calc-me';
let x = calc(2, "+2");
// 4
let x = calc(2, "+");
// 4
let x = calc(2, "++");
// 3
let x = calc(2, "+2","-2","*2","/2");
// 2
let x = calc(3, "+","-3","+","*4","/2");
// 12
Operations
- [num]
- [num]
- ++
- --
- [num]
- / [num]