What's the best way to store a key=>value
array in javascript, and how can that be looped through?(在javascript中存储key=>value
数组的最佳方法是什么,以及如何循环?)
The key of each element should be a tag, such as {id}
or just id
and the value should be the numerical value of the id.(每个元素的键应该是一个标记,例如{id}
或只是id
,值应该是id的数值。)
It should either be the element of an existing javascript class, or be a global variable which could easily be referenced through the class.(它应该是现有javascript类的元素,或者是可以通过类轻松引用的全局变量。)
jQuery can be used.(可以使用jQuery。)
ask by Click Upvote translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…