Building & Learning/바닐라JS-노마드코더
바닐라 JS로 크롬 앱 만들기 7장 강좌들 노마드코더 무료강좌
devlunch4
2025. 1. 17. 15:49
반응형
바닐라 JS로 크롬 앱 만들기 7장 강좌들 노마드코더 무료강좌
실질적인 TODO LIST를 생성하게 됩니다.
*
JSON.stringify()
JavaScript 객체를 JSON 문자열로 변환하는 함수입니다.
*간단예시 코드
const obj = { name: "Julia", age: 99, city: "London" };
const jsonString = JSON.stringify(obj);
console.log(jsonString);
// 출력: '{"name":"Julia","age":99,"city":"London"}'
*
JSON.parse()
JSON 문자열을 javaScript 객체로 변환하는 함수입니다.
const jsonString = '{"name":"Julia","age":99,"city":"London"}';
const obj = JSON.parse(jsonString);
console.log(obj);
// 출력: { name: 'Julia', age: 99, city: 'London' }
*
forEach()
배열의 각 요소를 순회하며, 콜백 함수를 실행하는 배열 메서드입니다.
const people = [
{ name: "Julia", age: 99, city: "London" },
{ name: "Madeleine", age: 30, city: "Toronto" },
{ name: "Anna", age: 25, city: "New York" }
];
people.forEach(person => {
console.log(`${person.name} is ${person.age} years old and lives in ${person.city}.`);
});
// 출력:
// Julia is 99 years old and lives in London.
// Madeleine is 30 years old and lives in Toronto.
// Anna is 25 years old and lives in New York.
*
7장 마지막
저장객체에 아이디 설정 - 날짜로 설정,
삭제 관련 기능 구현
끝!
반응형