Home  >  Q&A  >  body text

About converting js string into corresponding variable

Yes, this problem has really bothered me for a long time.

How to use text characters corresponding to existing variables


For example, there are already two array variables

array1

array2


#But I don’t know which one I need to use. I can only know the name of the corresponding array "array1"

Although it can be solved with if judgment, the array It would be too troublesome if the number is too large

Is there any way to know the array variable and directly assign it to an array with the corresponding name


哈哈哈哈。哈哈哈哈。2010 days ago1140

reply all(1)I'll reply

  • 明日边缘

    明日边缘2019-05-08 18:01:31

    Look at the code and you will know!

    reply
    0
  • Cancelreply