1 00:00:00,260 --> 00:00:01,160 Hello, guys. 2 00:00:01,160 --> 00:00:02,600 Good to see you back once again. 3 00:00:02,610 --> 00:00:07,520 I'm back with a new tutorial and in this tutorial we are going to learn about Jason. 4 00:00:07,820 --> 00:00:12,440 We are going to learn what is the usage of Jason and why should we learn? 5 00:00:12,800 --> 00:00:16,790 Now let's try to understand what is the meaning of Jason. 6 00:00:16,940 --> 00:00:24,830 Jason stands for JavaScript Object Notation, and if we talk about what is the usage of Jason, it is 7 00:00:24,830 --> 00:00:27,650 used to store and exchange data. 8 00:00:27,680 --> 00:00:32,060 Now you might confuse Jason is related to JavaScript. 9 00:00:32,090 --> 00:00:33,290 No it is not. 10 00:00:33,560 --> 00:00:36,440 It is not related to JavaScript. 11 00:00:36,440 --> 00:00:40,880 But there is a reason that we use JavaScript in its name. 12 00:00:41,240 --> 00:00:47,680 There is a thing in JavaScript which we call object literal, otherwise JavaScript object. 13 00:00:47,690 --> 00:00:52,730 When Jason was created, it is pretty similar with JavaScript objects. 14 00:00:52,910 --> 00:00:56,960 That is why it was known as JavaScript Object Notation. 15 00:00:56,960 --> 00:01:00,980 And once again I'm going to told you JavaScript is not related to Jason. 16 00:01:01,310 --> 00:01:04,490 It is only used for store and exchange data. 17 00:01:04,640 --> 00:01:09,560 Now let's talk more about it whenever we create a website. 18 00:01:09,560 --> 00:01:13,070 Otherwise web application its depend on two main thing. 19 00:01:13,070 --> 00:01:15,950 First one is client and second one is server. 20 00:01:16,460 --> 00:01:17,780 In your client site. 21 00:01:17,780 --> 00:01:23,720 It could be anything I want to say, it could be a mobile, otherwise laptop, desktop, etcetera. 22 00:01:23,810 --> 00:01:30,050 And whenever we need to exchange data and get the response at the current time otherwise too quickly, 23 00:01:30,050 --> 00:01:32,240 then we use Json between them. 24 00:01:32,630 --> 00:01:38,660 And as I told you, Json is not a language, it is data exchange format without Json. 25 00:01:38,660 --> 00:01:42,200 We have another popular data format which is XML. 26 00:01:42,200 --> 00:01:49,640 It is also used to exchange data, but as compared to XML, Json is more popular and reliable. 27 00:01:49,640 --> 00:01:53,480 But you might have question why Jason is more popular. 28 00:01:53,480 --> 00:01:57,350 And to understand it, first we need to talk about their syntax. 29 00:01:57,620 --> 00:02:01,910 If I talk about Json format, its look like in JavaScript object. 30 00:02:01,910 --> 00:02:06,980 In JavaScript objects we use curly braces and also we use key and value pair. 31 00:02:07,220 --> 00:02:09,710 But XML is different. 32 00:02:09,740 --> 00:02:12,140 This is the XML data format. 33 00:02:12,260 --> 00:02:16,040 Here we need to use tag like HTML to contain data. 34 00:02:16,040 --> 00:02:23,660 As you can see for their name we use name tag for age, we use tag and for the object here we use student 35 00:02:23,660 --> 00:02:24,050 tag. 36 00:02:24,050 --> 00:02:27,260 And there are a lot of difference between Json and XML. 37 00:02:27,530 --> 00:02:31,280 So let's see the difference between Json and XML. 38 00:02:31,550 --> 00:02:39,740 First they are full from Json stands for JavaScript Object Notation, but XML stands for Extensible 39 00:02:39,740 --> 00:02:41,240 Markup Language. 40 00:02:41,240 --> 00:02:45,200 It is a language, but Json is not a language. 41 00:02:45,200 --> 00:02:51,590 The next different is Json based on text format, but XML based on markup language. 42 00:02:51,590 --> 00:02:59,680 It is quite similar with HTML and it takes time to learn XML, but you can understand Json within 10 43 00:02:59,680 --> 00:03:00,740 to 20 minutes. 44 00:03:00,860 --> 00:03:05,300 Next point is Json is lightweight but XML is heavier. 45 00:03:05,300 --> 00:03:08,120 That's why Json is more popular than XML. 46 00:03:08,270 --> 00:03:17,090 Tags and properties make XML very heavier, but the benefit is XML support comments and namespace but 47 00:03:17,090 --> 00:03:19,910 Json do not support comments and namespace. 48 00:03:20,150 --> 00:03:24,380 Now let's see the difference between Json and JavaScript object. 49 00:03:24,380 --> 00:03:32,540 As we know, Json is pretty similar to JavaScript object, but not the same as exact JavaScript object. 50 00:03:32,540 --> 00:03:35,210 So first I'm going to show you the JavaScript object. 51 00:03:35,240 --> 00:03:39,050 When we create a JavaScript object, first we need to declare a variable name. 52 00:03:39,050 --> 00:03:42,680 Also, we need to use curly braces to create an object. 53 00:03:43,070 --> 00:03:46,040 And inside this curly braces we take key. 54 00:03:46,310 --> 00:03:50,300 Otherwise we can call it property and value at the same way. 55 00:03:50,450 --> 00:03:54,200 To create a Json object here we need to use curly braces. 56 00:03:54,200 --> 00:03:59,420 But the difference is we should take property name inside the double quotes every time. 57 00:03:59,540 --> 00:04:03,500 And also we need to take double quotes for our value. 58 00:04:03,830 --> 00:04:09,470 But if I talk about JavaScript object, we don't need to use double quotation for property name. 59 00:04:09,800 --> 00:04:17,750 Also, we can take single quotes for value, but we cannot use single quotes whenever we create Json 60 00:04:17,780 --> 00:04:18,440 object. 61 00:04:18,440 --> 00:04:24,500 And if you want to print a Json object or a JavaScript object, nearly we need to follow the same method. 62 00:04:24,920 --> 00:04:32,120 Now let's talk about what kind of data type Json support Json support, string, data type, number, 63 00:04:32,120 --> 00:04:35,630 data type, boolean, data type, array object, and NULL. 64 00:04:35,840 --> 00:04:39,530 If we want to send empty value, then we use null data type. 65 00:04:39,860 --> 00:04:45,430 Otherwise, if you forgot to pass a value, then by default it is going to send null. 66 00:04:45,440 --> 00:04:49,190 And to understand all the values here I create an example. 67 00:04:49,340 --> 00:04:52,520 At first, as I told you, we need to take curly braces. 68 00:04:52,550 --> 00:04:58,190 Then inside the curly braces here we set our first property which is ID and as I told you, we need 69 00:04:58,190 --> 00:04:59,840 to use double quotes to take. 70 00:05:00,040 --> 00:05:00,880 The property name. 71 00:05:01,030 --> 00:05:04,500 Then here we use number data type. 72 00:05:04,510 --> 00:05:07,150 That's why we do not use any double quotes. 73 00:05:07,540 --> 00:05:12,490 Our next property is name, but for name here I use string data type. 74 00:05:12,490 --> 00:05:15,300 That's why we need to take it in a double quotes. 75 00:05:15,310 --> 00:05:18,490 And for married here I use boolean data type. 76 00:05:18,490 --> 00:05:20,680 That's why here I take true value. 77 00:05:20,680 --> 00:05:24,130 And for boolean value we don't need to use any double quotes. 78 00:05:24,160 --> 00:05:29,050 If you use boolean data type here, you can pass true otherwise false value. 79 00:05:29,080 --> 00:05:33,730 But at the next example, as you can see here, we do not send any data. 80 00:05:34,350 --> 00:05:37,500 So by default it's going to set null value. 81 00:05:37,800 --> 00:05:41,700 And for this hobby property here I use array value. 82 00:05:42,120 --> 00:05:44,100 That's why I use square braces. 83 00:05:44,100 --> 00:05:46,830 And inside the square braces we take the values. 84 00:05:46,950 --> 00:05:51,150 And for an address here we use object datatype. 85 00:05:51,180 --> 00:05:52,500 It is an object. 86 00:05:52,500 --> 00:05:55,350 That's why again we take curly braces. 87 00:05:55,650 --> 00:06:03,510 But if you notice for our next property vehicle here we take multiple object value inside this object. 88 00:06:03,540 --> 00:06:08,850 Here we take multiple objects and it's called nested objects. 89 00:06:09,180 --> 00:06:12,330 So these are the data types that we can use in Json. 90 00:06:12,780 --> 00:06:15,660 Now let's talk about the advantages of Json. 91 00:06:16,110 --> 00:06:18,510 Jason came with human readable format. 92 00:06:18,540 --> 00:06:24,770 Anyone can easily understand Json if anyone not come from any programming language background. 93 00:06:24,780 --> 00:06:32,250 Also he can understand Json and the next advantage is it is completely language independent. 94 00:06:32,280 --> 00:06:39,000 We can use Json with every programming languages like Python, PHP, JavaScript, Kotlin, Java, whatever, 95 00:06:39,090 --> 00:06:40,830 whatever language you use. 96 00:06:41,070 --> 00:06:43,980 And also Json is very lightweight to use. 97 00:06:44,220 --> 00:06:47,910 We send data to server to client in a Json format. 98 00:06:47,940 --> 00:06:50,220 Json played a big role in Ajax. 99 00:06:50,250 --> 00:06:51,420 Also rest API. 100 00:06:51,460 --> 00:06:52,980 Otherwise any APIs. 101 00:06:53,010 --> 00:06:55,370 That's why Json is so important. 102 00:06:55,380 --> 00:06:59,100 But there is one big disadvantage of Json. 103 00:06:59,640 --> 00:07:02,550 We cannot transfer any media file as Json format. 104 00:07:02,580 --> 00:07:07,110 We cannot transfer audio, video, images or any binary information. 105 00:07:07,320 --> 00:07:10,620 Here we can pass only text based information. 106 00:07:10,770 --> 00:07:15,720 And here is another important thing that we are going to learn about in our practical session. 107 00:07:15,900 --> 00:07:17,830 So this is it for this tutorial. 108 00:07:17,850 --> 00:07:21,210 In the next tutorial I'm going to start the practical about Json. 109 00:07:21,210 --> 00:07:22,560 So thanks for watching this video. 110 00:07:22,560 --> 00:07:23,310 Stay tuned.