-
자바스크립트 JAVASCRIPT Json Arry list 에서 특정문자 포함된 값 가져오기수상한 프로그래머/죽은 소스 살려내는 꾸르팁 2019. 9. 23. 15:12반응형
const tempList = [{ NAME: 'ABCD' }, { NAME: 'CDEFG' }, { NAME: 'HIJK' }];
const searchData = tempList.filter(object => {
if (object.NAME.indexOf('CD') > -1) {
return object;
}
return null;
});
console.log(searchData);
실행결과 : [{ NAME: 'ABCD' }, { NAME: 'CDEFG' }]
반응형'수상한 프로그래머 > 죽은 소스 살려내는 꾸르팁' 카테고리의 다른 글
오라클 특정 조건 문자 정렬 방법 (0) 2020.01.02 자바스크립트 배열 특정 요소 삭제 javascript array delete object (4) 2019.10.02 JAVASCRIPT JSON OBJECT NULL CHECK 자바스크립트 오브젝트 비어있는 지 확인 방법 (0) 2019.09.05 내 아이폰을 맥북에서 미러링 해주고 싶을때 팁 (0) 2019.07.23 크롬 개발자 도구에서 객체 복사하는 방법 (0) 2019.05.08 댓글