我想创建一个看起来像这样的变量:
var projects = [
{
value: "jquery",
label: "jQuery",
desc: "the write less, do more, JavaScript library"
},
{
value: "jquery-ui",
label: "jQuery UI",
desc: "the official user interface library for jQuery"
},
{
value: "sizzlejs",
label: "Sizzle JS",
desc: "a pure-JavaScript CSS selector engine"
}
];
如何动态创建这样的变量?我会在一个循环中写这个,我想继续向声明的变量添加值。