I realized that using two different ways to organize JSON data may affect my code performance especially if I need to filter()
or map()
. The two cases are shown below, both cases will include thousands of lines of data:
[
//....
{
"url": "www.example2400.com"
}
{
"url": "www.example2401.com"
}
//...
]
Or:
{
"url": [
//...
"www.example2400.com",
"www.example2401.com",
//...
]
}
Which layout would provide better performance in terms of fetch()
, filter()
or map()
the data to render it on the page? Or is there a better layout?