解决方案:

   function create_variable(num){

          var name = "test_"+num;   //生成函数名
          window[name] = 100;
          window['name'] = 200;   //注意看中括号里的内容加引号和不加引号的区别
    }
参考链接:https://blog.csdn.net/qq_31238721/article/details/78257449

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2021-12-17
  • 2022-12-23
  • 2021-06-05
猜你喜欢
  • 2021-12-31
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2021-11-18
  • 2022-03-01
  • 2022-01-03
相关资源
相似解决方案