Because data is not just an Object - it's an Array. And when Arrays are json-stringified, all the non-numeric properties are discarded from result (as there's no way to represent them in [...] notation anyway).
If you still want to see that property in JSON, you have to use plain Objects. You can bite the bullet and just "plain-objectify" the original array with { ... } sugar:
const data = [{foo: "1", bar: "2"}, {foo: "2", bar:"3"}];
data.extra = ["a", "b"];
JSON.stringify( {...data} );
// "{"0":{"foo":"1","bar":"2"},"1":{"foo":"2","bar":"3"},"extra":["a","b"]}"
... but beware, all those "0", "1" props will be seen inside your JSON as is, and that's not the best of views. It's usually cleaner just to use additional property:
const data = [{foo: "1", bar: "2"}, {foo: "2", bar:"3"}];
const extra = ["a", "b"];
const output = {
data,
extra
};
JSON.stringify(output);
// "{"data":[{"foo":"1","bar":"2"},{"foo":"2","bar":"3"}],"extra":["a","b"]}"