Learn JSON files in 10 minutes! 📄

Поділитися
Вставка
  • Опубліковано 29 тра 2024
  • #javascript #tutorial #json
    // JSON = (JavaScript Object Notation) data-interchange format
    // Used for exchanging data between a server and a web application
    // JSON files {key:value} OR [value1, value2, value3]
    // JSON.stringify() = converts a JS object to a JSON string.
    // JSON.parse() = converts a JSON string to a JS object
    00:00:00 introduction
    00:00:36 create json files
    00:03:24 json.stringify()
    00:05:27 json.parse()
    00:07:10 fetch()
    00:09:30 conclusion

КОМЕНТАРІ • 30

  • @BroCodez
    @BroCodez  5 місяців тому +9

    // JSON = (JavaScript Object Notation) data-interchange format
    // Used for exchanging data between a server and a web application
    // JSON files {key:value} OR [value1, value2, value3]
    // JSON.stringify() = converts a JS object to a JSON string.
    // JSON.parse() = converts a JSON string to a JS object
    // ---------- JSON.stringify() ----------
    const names = ["Spongebob", "Patrick", "Squidward", "Sandy"];
    const person = {
    "name": "Spongebob",
    "age": 30,
    "isEmployed": true,
    "hobbies": ["Jellyfishing", "Karate", "Cooking"]
    };
    const people = [{
    "name": "Spongebob",
    "age": 30,
    "isEmployed": true
    },
    {
    "name": "Patrick",
    "age": 34,
    "isEmployed": false
    },
    {
    "name": "Squidward",
    "age": 50,
    "isEmployed": true
    },
    {
    "name": "Sandy",
    "age": 27,
    "isEmployed": false
    }];
    const jsonString = JSON.stringify(people);
    console.log(jsonString);
    // ---------- JSON.parse() ----------
    const jsonNames = `["Spongebob", "Patrick", "Squidward", "Sandy"]`;
    const jsonPerson = `{"name": "Spongebob", "age": 30, "isEmployed": true, "hobbies": ["Jellyfishing", "Karate", "Cooking"]}`;
    const jsonPeople = `[{"name": "Spongebob","age": 30,"isEmployed": true},
    {"name": "Patrick","age": 34,"isEmployed": false},
    {"name": "Squidward","age": 50,"isEmployed": true},
    {"name": "Sandy","age": 27,"isEmployed": false}]`;
    const parsedData = JSON.parse(jsonPeople);
    console.log(parsedData);
    // ---------- fetch() ----------
    fetch("people.json")
    .then(response => response.json())
    .then(values => values.forEach(value => console.log(value)))
    .catch(error => console.error(error));

  • @kadirertan8664
    @kadirertan8664 5 місяців тому +24

    even though i have watched so many JS tutorials i still watch bro's tutorials (especially while eating) because why not

    • @ahamednafees9961
      @ahamednafees9961 5 місяців тому +4

      Frr I've literally done projects in js still I'd watch whatever bro posts cus of the unique little things he teaches

    • @farhanarahman9375
      @farhanarahman9375 Місяць тому

      dont be in tutorial hello bro

    • @kadirertan8664
      @kadirertan8664 Місяць тому

      ​@@farhanarahman9375 Hello. Yes, you are right. It might seems like tutorial hell but I enjoy watching fundamentals and thats my method for practice fundamentals quickly.

  • @pastori2672
    @pastori2672 5 місяців тому +15

    im so glad you're making more backend specific videos

    • @shadyawad5383
      @shadyawad5383 4 місяці тому

      what do you mean "backend specific videos" ? where can i find those ?

    • @pastori2672
      @pastori2672 4 місяці тому

      @@shadyawad5383 stuff like interacting with other servers and using APIs http requests databases etc.. theres plenty of videos about them

    • @jawad_youtube
      @jawad_youtube 3 місяці тому +2

      aren't these used in FE too?

  • @CatholicWeeb
    @CatholicWeeb 5 місяців тому +1

    Thanks mate for your great videos, they help a lot!

  • @jiyoungkim9258
    @jiyoungkim9258 5 місяців тому +3

    love every JS series

  • @DeltaXML_Ltd
    @DeltaXML_Ltd 3 місяці тому

    Brilliant video!

  • @kartickm2022
    @kartickm2022 Місяць тому +2

    fetch isnt working for me at all. It is unable to read local json files.

  • @ofekcohen6559
    @ofekcohen6559 5 місяців тому +5

    hey bro. you plan to make node js and express js
    tutorial?

  • @vallunacoder.wecodetogether
    @vallunacoder.wecodetogether 4 місяці тому +1

    hey Bro I started this series almost a month ago, I have been struggling with JavaScript for a long time. But you videos are gold dude!! THANKS For your explanations 🤗🤗 Which course do you thing we should try after this one? GREETINGS FROM COLOMBIA LATIN AMERICA 🤩

  • @mraloush8959
    @mraloush8959 5 місяців тому +2

    i learned a lot of things from you as a noob. now i point my friends who are learning to you channel and they really like it

  • @cpu_governor
    @cpu_governor 5 місяців тому

    @BroCodez why are you creating a new javascript playlist, will the old one be deleted ?

  • @dandana5767
    @dandana5767 Місяць тому

    terimakasih bang, sangat membantu.

  • @oybekx3d
    @oybekx3d 2 місяці тому

    sup, u plannin next video for this one? Im learning json and ur videos help me a lot

  • @laperplayz1388
    @laperplayz1388 5 місяців тому +1

    yo bro can you please make an advanced c++ tutorial that talks about vectors and polymorphism, encapsulation, abstraction, and the auto keyword, and also new features added to the latest version please

  • @user-vx1ii2ic4v
    @user-vx1ii2ic4v 5 місяців тому

    Hey How about a tutorial for a low level language such as assembly language? I would also like to say that your cideos been a great help even if its just a hobby.

  • @hunin27
    @hunin27 5 місяців тому +3

    hey thanks bro, are you thinking about making more back end tutorials? i noticed you have a mySQL course but not really node js or anything else

    • @hunin27
      @hunin27 5 місяців тому +1

      2024 is amazing bro, thank you so much

    • @mraloush8959
      @mraloush8959 5 місяців тому

      @@BroCodez i would love a node.js one from you specifically bcs i just understand u all the time

    • @samilqs
      @samilqs 5 місяців тому

      @@BroCodez ur the goat, please share some social media to follow u bro

  • @doronfeldman5152
    @doronfeldman5152 5 місяців тому +1

    Can you do a node js course?

  • @sreenandhm6319
    @sreenandhm6319 4 місяці тому +1

    Bro can you please make unity or Unreal engine 5 Tutorial.

  • @seifeddinejaziri9312
    @seifeddinejaziri9312 3 місяці тому

    Please we need an angular tutorial

  • @Swxfty_
    @Swxfty_ 5 місяців тому +1

    Week 3 of asking for bro code to make a typescript series

  • @stingy.ae1
    @stingy.ae1 8 днів тому

    bro code , please do oop tutorial please , love you