We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7fa0aa commit 6c5c801Copy full SHA for 6c5c801
src/stringify.js
@@ -77,20 +77,21 @@ export function stringify(value) {
77
break;
78
79
case 'Array':
80
- /** @type {number[]} */
81
- let flattened_array = [];
+ str = '[';
82
83
for (let i = 0; i < thing.length; i += 1) {
+ if (i > 0) str += ',';
84
+
85
if (i in thing) {
86
keys.push(`[${i}]`);
- flattened_array.push(flatten(thing[i]));
87
+ str += flatten(thing[i]);
88
keys.pop();
89
} else {
- flattened_array.push(HOLE);
90
+ str += HOLE;
91
}
92
93
- str = `[${flattened_array.join(',')}]`;
94
+ str += ']';
95
96
97
0 commit comments