JSON Explained with JavaScript | JSON Tutorial for Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ค. 2024
  • Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
    In this JSON Tutorial for Beginners, we cover what JSON is, what JSON is used for, and how to work with JSON in Javascript.
    ▶ This video is part of the JavaScript Tutorials for Beginners Playlist found here: • Javascript Tutorials f...
    ✅ Quick Concepts outline:
    JSON:
    (00:00) Intro
    (0:11) JSON === JavaScript Object Notation
    (0:15) What is JSON and what is it used for?
    (0:49) Starting with a JavaScript Object
    (2:10) Convert a Javascript Object to JSON: JSON.stringify()
    (2:40) Comparing the object to the stringified JSON
    (3:16) Where's the method? It's gone!
    (3:38) JSON is definitely string data
    (4:20) Convert JSON to a Javascript Object: JSON.parse()
    (5:00) It is an object again!
    (5:20) Our parsed object does not contain the method
    (6:00) A summary of the process: From object to JSON string to parsing JSON to create a new object
    📚 Further Reading:
    MDN Web Docs:
    JSON Object: developer.mozilla.org/en-US/d...
    JSON reference: www.json.org/json-en.html
    📺 More Beginner JS Videos:
    freeCodeCamp: • Learn JavaScript - Ful...
    Traversy Media: • JavaScript Crash Cours...
    The Net Ninja: • Modern JavaScript Tuto...
    ✅ Follow Me:
    Twitter: / yesdavidgray
    Reddit: / daveoneleven
    Medium: / davegray_86804
    #json #tutorial #beginners
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 26

  • @Grihlo
    @Grihlo ปีที่แล้ว +5

    This video was so much easier after the previous one! I don't know why but when I saw the name JSON in title I was preparing to something hard to understand but it turned out to be false expectation. You made it easy and clear - thank you!

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  ปีที่แล้ว +1

      Glad to hear that and you're welcome! 💯

    • @adamwhite425
      @adamwhite425 ปีที่แล้ว +1

      @@DaveGrayTeachesCode is it going be hard find tech job because of all the lay off?

  • @adnan8465
    @adnan8465 2 ปีที่แล้ว +2

    thank you so much sir all the concepts are fully covered.. I am your new student from PAKISTAN

  • @CondeAlberto
    @CondeAlberto 2 ปีที่แล้ว +2

    Suddenly all that parsing slang I heard for years is succinctly yet clearly explained...
    😂

  • @YuRiSsS
    @YuRiSsS 2 ปีที่แล้ว

    Thank you for this video!

  • @oncoding4520
    @oncoding4520 ปีที่แล้ว

    You are great, love your "long" videos.

  • @SC-bv6kx
    @SC-bv6kx 3 ปีที่แล้ว +7

    JSON is not mysterious anymore. "stringify" to send, "parse" to get. ✌

  • @yatin1370
    @yatin1370 ปีที่แล้ว

    Having heard the term JSON couple of times before, I thought I need to be a wizard to understand it. I guess we never know what we can do until we try to learn jargon and not get overwhelmed by it. Thanks Dave 🙏

  • @khoile4477
    @khoile4477 3 หลายเดือนก่อน

    wish i found your videos much sooner

  • @dzentsetsu5607
    @dzentsetsu5607 3 ปีที่แล้ว +1

    Thanks for tut Dave! Have a question. Correct me if I am wrong, we trim functions from objects (or rather JS to it for us) for security reason or functions considers to be just not "valuable data"?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  3 ปีที่แล้ว +3

      Good question! I am guessing at the reason when I answer, but it is part of the JSON specs for sure. I do think security issues would arise if functions were stored in localStorage as strings and then allowed to be called back into action in application code. Functions are data and in JS, they are "first class functions" which allows us to pass them as parameters to other functions and more. My guess is the JSON spec was thinking about security issues.

    • @dzentsetsu5607
      @dzentsetsu5607 3 ปีที่แล้ว +2

      @@DaveGrayTeachesCode Thanks for reply! You taught me so much. I can't express enough gratitude

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  3 ปีที่แล้ว

      @@dzentsetsu5607 You're welcome!

  • @godwingeo6436
    @godwingeo6436 2 ปีที่แล้ว +1

    Nice work Sir. Really helpful. Also please teach us how to implement JavaScript in dynamic website....

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 ปีที่แล้ว +2

      Thanks for the note! My full course video will take you through working with web pages and fetching data, too: th-cam.com/video/EfAl9bwzVZk/w-d-xo.html 🚀

    • @godwingeo6436
      @godwingeo6436 2 ปีที่แล้ว

      @@DaveGrayTeachesCode ok thanks...may i know which country you belong to?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 ปีที่แล้ว +1

      @@godwingeo6436 yes, I am in the US.

  • @abdulrahmanagboolaosho3582
    @abdulrahmanagboolaosho3582 ปีที่แล้ว

    for those watching this video at a later time, you don't need to add semicolons at the end of each line of code as long you ar not writing your lines of code together
    like this
    console.log(Hello World!) alert("lets play a game")
    for example
    console.log("Hello World");
    console.log(Hello World)
    The 2 above statements do the same thing

  • @shubhamarora547
    @shubhamarora547 3 ปีที่แล้ว

    👍👍