I have a variable called "animeData" that contains an array of objects.
{"table":[{"id":1,"name":"K-on","redirect":"k-on","thumbnail":"/images/anime/k-on/thumbnail.jpg","characters":[{"name":"azusa","thumbnail":"/images/anime/k-on/azusa.jpg","votes":[{"ip":"127.0.0.1"}]},{"name":"mio","thumbnail":"/images/anime/k-on/mio.jpg","votes":[{}]},{"name":"mugi","thumbnail":"/images/anime/k-on/mugi.jpg","votes":[{}]},{"name":"ritsu","thumbnail":"/images/anime/k-on/ritsu.jpg","votes":[{}]},{"name":"yui","thumbnail":"/images/anime/k-on/yui.jpg","votes":[{}]}]},{"id":2}]}
I am trying to add a new set of information, under the ID 2, like I did for 1, starting with the name.
I have tried animeData.table.filter(x => x.id === 2).push({"name": "Bunny Girl Senpai"});
However, there are no errors in the console but nor does the "animeData" var change.
animeDatawon't be changed,Array.prototype.filter()returns a new array