displayAbbreviation(){ var abbreviations = document.getElementsByTagName("abbr"); if (abbreviations.length < 1) return false; var defs = new Array(); for (var i = 0; i<abbreviations.length; i++) { var current_abbr = abbreviations[i]; var definition = current_abbr.getAttribute("title"); var key = current_abbr.lastChild.nodeValue; defs[key] = definition; }}displayAbbreviation()?函數(shù)中的最后一行“defs[key] = definition”不太明白,defs的中括號中的參數(shù)不應(yīng)該是數(shù)字嗎?而key返回的是一段文本吧? js小白一枚,求詳解。
關(guān)于數(shù)組的"[]"當(dāng)中的參數(shù)問題
Gnayoul
2016-08-27 00:12:30