-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON is kind of useless unless it has proper key/values #62
Comments
I agree, good idea for next major release, thanks. |
Object.getOwnPropertyNames(json)
Object.keys(json)
for(let key in json) {
// ...
} will do the thing - no need for changing the structure |
It is also easy to iterate over with |
@ckwagaba There is https://github.com/umpirsky/country-list/blob/master/data/en/country.php for PHP. No need to json decode. |
How did I miss that? Thanks for that. |
this new format is usefull only if it contains some other data for example flag or list of locales |
Or you could use Object.entries(json).map(([key, value]) => key + " - " + value); |
No seriously. The format of the JSON data is absolutely horrific. Why would anyone think this is a good idea? |
With JS frameworks, and more generally REST APIs/HTTP requests, the current JSON structures are not much help, since we can't programmatically target keys.
How about this structure?
The text was updated successfully, but these errors were encountered: