What is JSON? Introduction (Part 1/4)

preview_player
Показать описание

Official site

Twitter
Рекомендации по теме
Комментарии
Автор

The JSON Alex used for demonstration is perfectly fine, in fact it is best practice to have data clearly labeled during development, but for final data output it would be best practiced to have a separate fully compacted copy of the data, this will reduce the .json file size being served for larger arrays.

But for the sake of being thorough for beginners, the array demonstrated in this video can be further simplified as shown below, and it is still 100% valid.

[
    [
        [
            "Alex",
            true
        ],
        [
            "Billy",
            false
        ]
    ]
]

and below is the same data completely compacted.

[[["Alex", true], ["Billy", false]]]

Note that when storing values without key names, square brackets are used instead of curly brackets.

Without assigning key names to each sub-array item, the keys names are now replaced with numeric values determined by their order in the sub-array.

jesterjunk
Автор

Thank you very much for this video, Alex :) !!!

georgigeorgiev
Автор

hey Alex can you do a tutorial on sticky navigation menu

collinrobinson
Автор

Is this used to copy data of any kind on the phone or computer ..

elizabethmarie
Автор

wow good job java community you finally shortened your syntax

Hppyhppy
Автор

I have a question. Is obj a collection of two separate instances of poeple? Or, is it the two people combined?

aj
Автор

json IS part of JS, of course it looks the same as JS! lol

GifCoDigital
Автор

U JUST made teh connection that a JSON file looks like a JS object b/c it IS a JS object!

ufotofu
Автор

I get that an array can contain, strings, objects etc. but how come you didn't put the first PEOPLE in quotes?

ers