变量运算符可能吗?
有没有办法做类似于以下任何一种情况:
var1 = 10; var2 = 20;var operator = "<";console.log(var1 operator var2); // returns true
- 要么 -
var1 = 10; var2 = 20;var operator = "+";total = var1 operator var2; // total === 30
慕的地10843
慕容708150
相关分类