Home > Q&A > body text
An object is defined in the module, such as: let a = {}, how can we find the object a through the string 'a'?
为情所困2017-07-05 11:04:32
// eval不好吗 var a = {b:1}; var str = 'a'; console.log(eval(str))
我想大声告诉你2017-07-05 11:04:32
Search locally or globally