-
Notifications
You must be signed in to change notification settings - Fork 0
/
object-examples.js
96 lines (84 loc) · 2.39 KB
/
object-examples.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
var complexObject = {
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters":
{
"batter":
[
{ "id": "1001", "type": "Regular" },
{ "id": "1002", "type": "Chocolate" },
{ "id": "1003", "type": "Blueberry" },
{ "id": "1004", "type": "Devil's Food" }
]
},
"topping":
[
{ "id": "5001", "type": "None" },
{ "id": "5002", "type": "Glazed" },
{ "id": "5005", "type": "Sugar" },
{ "id": "5007", "type": "Powdered Sugar" },
{ "id": "5006", "type": "Chocolate with Sprinkles" },
{ "id": "5003", "type": "Chocolate" },
{ "id": "5004", "type": "Maple" }
]
};
var nestedObject = { "test": { id: "1001", "type": "Everything works fine :-)" } }
var arrayOfObjects = [
{ "id": "1001", "type": "Regular" },
{ "id": "1002", "type": "Chocolate" },
{ "id": "1003", "type": "Blueberry" },
{ "id": "1004", "type": "Devil's Food" }
];
var arrayExample = [
"Orange",
"Banana",
"Apple",
"Kiwi"
];
var textColor = '#0088ff';
var cssArray = [
{ text: 'I am blue!', color: 'blue' },
{ text: 'I am green!', color: 'green', },
{ text: 'I am red!', color: 'red' }
];
var objectWithArrayOfObjects = {
"batter":
[
{ "id": "1001", "type": "Regular" },
{ "id": "1002", "type": "Chocolate" },
{ "id": "1003", "type": "Blueberry" },
{ "id": "1004", "type": "Devil's Food" }
]
}
var simpleVariable = 'My favourite animal is the walrus';
var apiExampleList = {};
var tryVariable = {test: 1};
var googleURL = 'https://www.google.com/';
var nestedArray = [
{
title: 'Test 1',
subTitle: 'Sub 1',
items: [
{ title: 'Test 1.1', subTitle: 'Sub 1.1' },
{ title: 'Test 1.2', subTitle: 'Sub 1.2' }
]
},
{
title: 'Test 2',
subTitle: 'Sub 2',
items: [
{
title: 'Test 2.1',
subTitle: 'Sub 2.1',
items: [
{ title: 'Test 2.1.1' },
{ title: 'Test 2.1.2' }
]
},
{ title: 'Test 2.2', subTitle: 'Sub 2.2' }
]
}
];
var arrayOfNumbers = [1, 2, 3, 4];