forked from wesbos/hot-tips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
array.at.js
69 lines (63 loc) · 1.25 KB
/
array.at.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
57
58
59
60
61
62
63
64
65
66
67
68
69
const tops = [
'sauce',
'cheese',
'pepperoni',
'sausage',
'peppers',
'onions',
'mushrooms',
];
const rgba = [
255,
0,
0,
0.2,
0,
255,
0,
0.8,
];
// prettier-multiline-arrays-set-line-pattern: 4
const rgbaGood = [
255, 0, 0, 0.2,
0, 255, 0, 0.8,
];
// prettier-multiline-arrays-set-line-pattern: 2 1
const people = [
'Wes', 'Bos',
123,
'Scott', 'Tolinksi',
456,
];
// prettier-multiline-arrays-set-line-pattern: 1 2 3 4 5 6 5 4 3 2 1
const shit = [
'💩',
'💩', '💩',
'💩', '💩', '💩',
'💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩',
'💩', '💩', '💩',
'💩', '💩',
'💩',
'💩',
'💩', '💩',
'💩', '💩', '💩',
'💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩', '💩',
'💩', '💩', '💩', '💩',
'💩', '💩', '💩',
'💩', '💩',
'💩',
];
tops.at(0);
tops.at(1);
tops[tops.length - 1];
tops.at(-1);
tops.at(-2);
tops[Math.floor(Math.random() * tops.length)];
tops.at(Math.random() * tops.length);