배열과 객체
let mark =[10,20,30,40,50,90];
const fruits =["오렌지","사과","바나나","포도"];
const mixed =[3,5,[6,"푸샨"]];
const arr4 =new Array(23,144,"버전");//java와 마찬가지로 배열을 초기화하는 새로운 메소드
console.log(arr4);
console.log(마크);

배열의 길이
console.log(marks.length);

//배열 값 변경
마크[1]=200000;
console.log(마크);

색인
console.log(marks.indexOf(30));//존재하므로 배열의 인덱스 제공
console.log(marks.indexOf(1000000000000));//배열에 존재하지 않으므로 -1 제공

배열의 메서드
푸시 -마지막에 추가
mark.push(70);
console.log(마크);
unshift -처음에 추가
mark.unshift(100);
console.log(마크);
pop - 배열의 마지막 요소를 제거합니다.
마크.팝();
console.log(마크);
shift-it은 처음부터 요소를 제거합니다.
mark.shift();
console.log(마크);
splice - 주어진 인덱스에서 요소를 제거합니다.
mark.splice(1,3);
console.log(마크);
*reverse - 배열을 뒤집습니다 *
mark.reverse();
console.log(마크);
배열을 다른 배열과 concat-concat
마크2=[100,200,300,400,500];
마크=marks.concat(marks2);
console.log(마크);

**All the properties are changing the whole array**
Reference
이 문제에 관하여(배열과 객체), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/pushanverma/arrays-and-objects-1jof텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)