배열
-
[자바스크립트] 배열과 집합 ([], set())개발공부/JavaScript 2024. 1. 31. 22:31
본 글은 배열과 집합을 다룬 내용입니다. 목차 1. 배열과 집합을 차이점 2. 성능 3. 배열 4. 집합 1. 배열과 집합의 차이점 개발자는 데이터를 효율적으로 다루고 관리하기 위해 다양한 상황에 적절한 자료구조를 선택하고 활용할 수 있어야 한다. 데이터를 어떻게 관리하는지에 따라 프로그램의 성능이 달라진다. 그래서 우리는 늘 적절한 선택을 해야한다. 데이터 구조의 특징을 잘 기억해야지 적절한 선택을 할 수 있다는 점을 잊지 말고 공부하면 좋겠다! 이제 본론으로 돌아와 배열과 집합의 차이점을 정리하면 아래와 같다. 집합은 중복을 허용하지 않는 고유 값들의 모임 배열은 중복을 허용하고, 순서를 갖는 값들의 모임 여기서 기억해야 할 키워는 중복과 순서이다. 집합은 중복 X, 순서 X 배열은 중복 O, 순서 ..