JS 空对象内插入对象
2021-01-30 15:16
标签:res obj set name nbsp gas sha let span JS 空对象内插入对象 标签:res obj set name nbsp gas sha let span 原文地址:https://www.cnblogs.com/iblackly/p/13195666.html 1 let Obj = {}
2
3 let ID = "cd4fg62sd4gasg4nsetjmu"
4 let ID2 = "a3526d8hs56df5sd5df45d"
5
6 let Res = {
7 name:"阿西吧",
8 lv:666
9 }
10 let Res2 = {
11 name:"阿西吧",
12 lv:666
13 }
14
15
16 let TempVar = {}
17 TempVar[ID] = Res
18
19 TempVar
20 //TempVar{
21 // cd4fg62sd4gasg4nsetjmu{
22 // lv: 666
23 // name: "阿西吧"
24 // }
25 //}
26
27 Obj.SuiBianSha = TempVar
28
29 Obj.SuiBianSha[ID2] = Res2
30
31 Obj
32 //Obj{
33 // SuiBianSha{
34 // a3526d8hs56df5sd5df45d{
35 // lv: 666
36 // name: "阿西吧"
37 // },
38 // cd4fg62sd4gasg4nsetjmu{
39 // lv: 666
40 // name: "阿西吧"
41 // }
42 //}
上一篇:js写一个简单的九九乘法表
下一篇:php判断客户端类型