0
我有一个结尾不同,如连接字符串,使可变
fibrecementrustedorpoppedfixings
fibrecementrustedorpoppedfixingsprice
fibrecementrustedorpoppedfixingsunits
fibrecementrustedorpoppedfixingsrange
我正在寻找一种方式变多变量能够只使用主变量,然后添加在哪里所需的最后一部分在功能上类似
fibrecementrustedorpoppedfixings +价格将打印fibrecementrustedorpoppedfixingsprice的价值
您可能想要使用数组 - https://www.w3schools.com/js/js_arrays.asp –
可能重复[转换字符串到JavaScript中的变量名称](https://stackoverflow.com/questions/5613834/convert-string-to-variable-name-in-javascript) – Stijn
在字符串上使用'eval' – Jaya