Is it advisable to use arrays in Javascript using tens of thousands of indexes?
I have a database which contains a table of static data, meaning that it will never change. In this case would it be advisable to convert this table to a javascript array and look the info up in there when needed? Is this bad practice?
The table in question contains roughly 40,000 key/value pair entries.
No.
I'd keep the table, as its a single point of maintenance.
You'll find that doing a XmlHTTPRequest to return a key/value pair based on a server side query, would actually perform faster, and have significantly less memory footprint than a huge JavaScript array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With