js eval传参


  let fun_str = value; //例:function(a,b){return a.value+b.value}
    try {
      fun_str = fun_str.replace(/[\r\n]/g, "");
      let fun;//this is useful 
      let func = 'fun=' + fun_str;
      let result = eval(func)(a, b);
        return result;
    } catch (err) {
      console.error(fun_str);
      console.log(a, b)
      return true;
    }

用于用户界面配置生成function


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM