-1
I 이하의 방법이 :대해 forEach() 필터() 안의
getDeviceErrors(error) {
this.devices = this.data.segment.data.devices.filter((device) => {
device[this.data.label].error.forEach((errorObj) => {
if (errorObj.id === error.id) {
console.log(true);
return true;
}
});
});
}
true
있지만 this.devices
가 여전히 비어 콘솔에 출력된다.
왜 그런가?
'forEach' 콜백은 true를 반환하지만'filter' 콜백은 반환하지 않습니다 ... – ASDFGerte