-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-array-format.html
More file actions
66 lines (59 loc) · 2.06 KB
/
test-array-format.html
File metadata and controls
66 lines (59 loc) · 2.06 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Array/Object Format Test</title>
</head>
<body>
<h1>Testing DevMirror Array/Object Formatting</h1>
<button id="test">Run Tests</button>
<script>
document.getElementById('test').addEventListener('click', () => {
console.log('Testing array formatting:');
// Test 1: Simple array
const simpleArray = [1, 2, 3, 4, 5];
console.log('Simple array:', simpleArray);
// Test 2: Array with objects
const arrayWithObjects = [
{id: 1, name: 'Alice', age: 30},
{id: 2, name: 'Bob', age: 25},
{id: 3, name: 'Charlie', age: 35}
];
console.log('Array with objects:', arrayWithObjects);
// Test 3: Large array (like the one in the logs)
const largeArray = [];
for (let i = 0; i < 45; i++) {
largeArray.push({
index: i,
value: `Item ${i}`,
timestamp: Date.now()
});
}
console.table('Large array (TABLE):', largeArray);
// Test 4: Nested object
const nestedObject = {
level1: {
level2: {
level3: {
data: 'Deep nested value'
}
},
array: [1, 2, 3]
},
count: 42
};
console.log('Nested object:', nestedObject);
// Test 5: Object with many properties
const bigObject = {};
for (let i = 0; i < 30; i++) {
bigObject[`prop_${i}`] = `Value ${i}`;
}
console.log('Object with many properties:', bigObject);
// Test with stack trace
console.group('Group with stack trace');
console.log('This should have a stack trace');
console.trace('Test trace');
console.groupEnd();
});
</script>
</body>
</html>