-
Notifications
You must be signed in to change notification settings - Fork 26
/
index2.js
56 lines (46 loc) · 1.16 KB
/
index2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// 物件 Array
let classA = ['小明', '小白', '小華']
// console.log('轉學前:', classA)
classA.push('小黃')
// console.log('轉學後:', classA)
let igPhotos = [
'https://xx.img.com/a1.png',
'https://xx.img.com/a2.png',
'https://xx.img.com/a3.png'
]
// console.log('第1筆', igPhotos[0]) // index = 0
// console.log('第2筆', igPhotos[1])
// console.log('第3筆', igPhotos[2])
// console.log('第4筆', igPhotos[4])
// TODO del
// console.log('igPhotos', igPhotos)
// console.log('igPhotos len', igPhotos.length)
// 長度
// TODO del
// console.log(classA.length)
// 物件 Object
const card = {
name: '布魯斯前端的名片',
addres: '新加坡xxxxxx',
age: 999,
}
// TODO del
console.log('名字', card.name) // . => card的name
const post = {
image: 'https://xx.img.com/a1.png',
desc: '這是一張圖片',
date: '2022/02/02',
comment: ['好漂亮', '我也要去...']
}
const post2 = {
image: 'https://xx.img.com/a2.png',
desc: '這是一張圖片',
date: '2022/02/03',
comment: ['好漂亮', '我也要去...', '好漂亮', '我也要去...'],
}
const wall = [
post,
post2,
]
// TODO del
// console.log('wall', wall)