Learn JSON files in 10 minutes! 📄
2024 ж. 27 Сәу.
25 165 Рет қаралды
#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
// 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));
even though i have watched so many JS tutorials i still watch bro's tutorials (especially while eating) because why not
Frr I've literally done projects in js still I'd watch whatever bro posts cus of the unique little things he teaches
dont be in tutorial hello bro
@@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.
im so glad you're making more backend specific videos
what do you mean "backend specific videos" ? where can i find those ?
@@shadyawad5383 stuff like interacting with other servers and using APIs http requests databases etc.. theres plenty of videos about them
aren't these used in FE too?
Thanks mate for your great videos, they help a lot!
love every JS series
Brilliant video!
terimakasih bang, sangat membantu.
hey bro. you plan to make node js and express js tutorial?
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
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 🤩
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.
sup, u plannin next video for this one? Im learning json and ur videos help me a lot
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
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
2024 is amazing bro, thank you so much
@@BroCodez i would love a node.js one from you specifically bcs i just understand u all the time
@@BroCodez ur the goat, please share some social media to follow u bro
@BroCodez why are you creating a new javascript playlist, will the old one be deleted ?
Can you do a node js course?
Bro can you please make unity or Unreal engine 5 Tutorial.
Please we need an angular tutorial
Week 3 of asking for bro code to make a typescript series
fetch isnt working for me at all. It is unable to read local json files.