강의

멘토링

커뮤니티

Inflearn Community Q&A

xoals6798572's profile image
xoals6798572

asked

A real introductory all-in-one development boot camp for non-majors

Conditional Question

배열 객체안에 추가하는 함수가 궁금합니다.

Written on

·

397

1

ㅇ안녕하세요 그랩님 현재 문제와는 좀 다른 질문일 수 있으나 궁금하여 질문을 남깁니다! products 변수 안에 객체가 2개 있는데 새로운 객체를 추가할 수 있는 방법이 있을까요? 동일하게  name , description 키값등을 추가하여 만들고 싶습니다. 

 

tensorflowexpressHTML/CSSreactnodejs머신러닝 배워볼래요? javascriptreact-native

Answer 2

2

xoals6798572님의 프로필 이미지
xoals6798572
Questioner

products.push({name:"야구공"})

이렇게 추가하면 되네요!

0

grab님의 프로필 이미지
grab
Instructor

넵 Array에서 새로운 요소를 추가할 때 push를 사용하시면 됩니다 :)

xoals6798572's profile image
xoals6798572

asked

Ask a question