728x90
Array 예제)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
var nums = new Array(2,3,"hello",7);
console.log(nums);
</script>
</body>
</html>
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
설명)
var nums 라는 객체에 new Array(2,3,"hello",7); 배열을 넣어주고 console.log에서 뿌려준다.
실행결과)
결론) JavaScript Array 전역 객체는 배열을 생성할 때 사용하는 리스트 형태의 고수준 객체이다.
그렇기에 정수 2,3,7 스트링 "hello"가 들어가는 것으로 보아 자바스크립트 Array에 객체를 넣어줄 수 있는 것이다.
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array
반응형
'2019백업' 카테고리의 다른 글
자바스크립트 - Object, JSON (0) | 2019.07.23 |
---|---|
자바스크립트- `${}`Template Literals (0) | 2019.07.23 |
20. 자손 선택자(space) VS 자식 선택자 (>) (0) | 2019.07.22 |
19. Css 가상 클래스 before, after (0) | 2019.07.22 |
18. overflow속성 (0) | 2019.07.22 |