Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好我已经使用以下代码片段来创建数组。
var rows = []; rows["_id1"] = 1;
但在这种情况下 1 没有插入到数组中。有没有其他方法可以实现这一点。
截屏:
让它成为一个对象。
var rows = {}; rows["_id1"] = 1;
或者如果你真的想要一个数组,你可以有一个对象数组
rows.push({"_id1": 1});