我有以下内容,我正在动态创建一个链接,我被拆分的串联所困扰。
link = "<li><span id='number'>" + link.split(" ")[0] + ".</span>" // Adding a "peroid" character after the reason number and make it bold
+ "<a href='#" + reasonTitle + "' " // Open link tag off adding href with relevant reference
+ "onclick=\"_gaq.push([\'_trackEvent\', \'" + experimentConversionReference + "\', \'ReasonClicked\', \'" + reasonTitleSpaces + "\'])\;\">" // Adding event tracking for google
+ link.split(/\d/)[1] // Add back on the back end of the split string
+ "</a>" // Close link tag off
+ "</li>";
更具体地说line 4
,我想从上面抓取并打印数组中的所有内容,[1]
我该怎么做?
我不想做的是
link.split(/\d/)[1] + link.split(/\d/)[2] + link.split(/\d/)[3] + link.split(/\d/)[]
等等。