객체안에 객체값 더하기
"table" :{ "userId": "5ede0bbd1dcbcf2974858154", "sumPoint": 20, "study": { "1": { "point": 10 }, "2": { "point": 20 }, "3": { "point": 30 }, "4": { "point": 10 }, "5": null, "6": null, "7": null, }, "__v": 0 } 이렇게 "table"객체 안에 null도 삽입되어있고 1,2,3,4 객체안에 point의 합산을 구할때 for문으로 for (var key in table.study) { console.log(table.study[key].point) } 이렇게 넣으면 log 창에는 10 20 30 10 이렇게 뜨지만 TypeError: Cannot..
2020.06.09