간혹 메모리 주소로 보면(얕은 복사) 안되는 경우가 있다
깊은 복사 값까지 따로 복사한다.
깊은 복사를 하자
response.forEach(function (item) { item.type = typeKey[0]; $('#ulAll').append(settingTemplate(item)); if(item.listYn === 'Y') { let newObj = Object.assign({}, item); newObj.type = typeKey[1]; ulList.push(newObj); } if(item.dnldYn === 'Y') { let newObj = Object.assign({}, item); newObj.type = typeKey[2]; ulDnld.push(newObj); } });