A
A
Alexander Razumov2019-01-23 16:12:23
JavaScript
Alexander Razumov, 2019-01-23 16:12:23

The JSON.stringify function does not work correctly. Why?

There is such a data structure in js: 5c4867e7e2833213047807.png
When executing JSON.stringify, instead of the normal json representation of the data structure, we get something like "[]" https://monosnap.com/file/wteGoV9miG4jnuanbhfjQ1jp...
Why is this happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-01-23
@razumovsu

Everything works correctly. Properties whose names are not integers greater than or equal to zero are discarded. You have an array. Use an object.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question