1 00:00:01,470 --> 00:00:02,240 Welcome back. 2 00:00:02,280 --> 00:00:05,370 In this lecture, we are going to call the functions that we created. 3 00:00:05,580 --> 00:00:08,620 I hope we understand what we have done in these functions, right. 4 00:00:08,970 --> 00:00:19,020 So this Substring actually had some links here that I would show to you, but I don't know what happened. 5 00:00:19,050 --> 00:00:29,030 The browser crashed and that was for math, not abstract function JavaScript. 6 00:00:29,280 --> 00:00:31,680 And this is from Developer Musila. 7 00:00:31,720 --> 00:00:32,610 You can read it here. 8 00:00:32,970 --> 00:00:33,360 Right. 9 00:00:33,600 --> 00:00:36,770 So these returns, the absolute value of a number. 10 00:00:37,150 --> 00:00:37,980 You can read more. 11 00:00:38,310 --> 00:00:41,010 And there are actually a couple of nice examples. 12 00:00:41,010 --> 00:00:41,250 Right. 13 00:00:41,400 --> 00:00:45,960 So when we have a string that is minus one is actually going to return an absolute number, that will 14 00:00:45,960 --> 00:00:47,040 be one. 15 00:00:47,320 --> 00:00:49,590 This we're going to return to the note. 16 00:00:49,620 --> 00:00:51,510 This an empty area. 17 00:00:51,520 --> 00:00:54,270 It will return always zero in this here. 18 00:00:54,330 --> 00:00:57,090 Not applique, not a number. 19 00:00:57,180 --> 00:00:59,970 OK, now that is what I'm trying to do. 20 00:00:59,970 --> 00:01:00,840 And also 21 00:01:03,480 --> 00:01:04,230 substring. 22 00:01:04,230 --> 00:01:06,020 We use that one. 23 00:01:06,030 --> 00:01:07,850 You can read it if you want more. 24 00:01:08,160 --> 00:01:11,670 But actually, I have read three schools. 25 00:01:12,810 --> 00:01:19,040 They have nice example here and you can read using JavaScript string substring method. 26 00:01:19,290 --> 00:01:20,880 So they're similar, but they're not the same. 27 00:01:21,060 --> 00:01:21,450 Right. 28 00:01:21,780 --> 00:01:23,130 OK, that's pretty much it. 29 00:01:24,480 --> 00:01:29,280 Those were the two lectures that I want to show to you now here. 30 00:01:29,280 --> 00:01:30,870 Just common. 31 00:01:30,880 --> 00:01:34,950 This sport we don't need we don't need these kinds of luck. 32 00:01:34,950 --> 00:01:35,660 You can delete it. 33 00:01:35,930 --> 00:01:38,610 Oh, I will delete it from here. 34 00:01:39,210 --> 00:01:39,460 Right. 35 00:01:39,530 --> 00:01:41,160 I will delete this one from here. 36 00:01:41,310 --> 00:01:43,560 I just want my code to be a little bit cleaner. 37 00:01:44,070 --> 00:01:44,490 Right. 38 00:01:44,730 --> 00:01:49,840 And I'm just going to delete that one and that one because there is nothing, no importance. 39 00:01:49,840 --> 00:01:51,150 So I hope you understand it. 40 00:01:51,420 --> 00:01:52,380 This first part. 41 00:01:52,390 --> 00:01:55,740 It is it is mandatory. 42 00:01:55,740 --> 00:01:56,910 You need to pass in here. 43 00:01:57,190 --> 00:01:58,350 The second part is optional. 44 00:01:58,350 --> 00:02:02,190 If you don't put it the whole string, the whole number or string will be returned. 45 00:02:02,430 --> 00:02:05,610 And this is starting from zero and this is the link minus three. 46 00:02:05,610 --> 00:02:09,290 And actually we just go from zero and minus three. 47 00:02:09,300 --> 00:02:11,720 So actually one of two one space, right. 48 00:02:11,760 --> 00:02:12,920 When we have two thousand. 49 00:02:13,590 --> 00:02:17,490 Now the other one, you just this is just exactly the same. 50 00:02:17,760 --> 00:02:21,840 But this guy here, we put it in front and actually we're doing OK. 51 00:02:22,020 --> 00:02:29,010 Start from third position going from if you count it from right, left and just go there, bam, that's 52 00:02:29,010 --> 00:02:29,150 it. 53 00:02:30,240 --> 00:02:32,550 Now, one more thing here. 54 00:02:33,630 --> 00:02:37,400 You need to put a variable in variable here. 55 00:02:38,160 --> 00:02:38,640 Good. 56 00:02:39,330 --> 00:02:40,920 Now we will be able to use them. 57 00:02:40,920 --> 00:02:42,330 We will use this function. 58 00:02:42,330 --> 00:02:44,390 We will call them in an item. 59 00:02:44,400 --> 00:02:45,840 So where are we going to call in here? 60 00:02:46,200 --> 00:02:49,650 These formant format calories. 61 00:02:49,860 --> 00:02:51,990 I'm going to base them here. 62 00:02:52,000 --> 00:02:53,010 OK, nice. 63 00:02:53,880 --> 00:02:54,330 Oops. 64 00:02:54,330 --> 00:02:55,790 It's not working now. 65 00:02:55,800 --> 00:03:05,030 It's not for there I have I you so salad one five fifty point five oh. 66 00:03:05,190 --> 00:03:08,700 Let's add one thousand five hundred fifty. 67 00:03:08,940 --> 00:03:09,420 Cool. 68 00:03:09,720 --> 00:03:11,040 Now go back here. 69 00:03:12,060 --> 00:03:16,860 You will see only this ugly little here and you will see this one. 70 00:03:17,010 --> 00:03:17,400 Right. 71 00:03:17,760 --> 00:03:21,720 This is something we didn't want to happen but we still haven't used. 72 00:03:22,680 --> 00:03:27,660 We still we haven't used the actual function and here it is. 73 00:03:27,660 --> 00:03:29,010 We use the function for here. 74 00:03:29,250 --> 00:03:35,400 Now I know something that this should be plus here and probably we do have. 75 00:03:37,460 --> 00:03:44,630 OK, we do have somewhere for the calories we need to add the plus there, right cool is for the burn. 76 00:03:44,630 --> 00:03:45,680 We should have the minus. 77 00:03:46,010 --> 00:03:46,840 Check that one. 78 00:03:47,180 --> 00:03:47,720 Here it is. 79 00:03:47,930 --> 00:03:49,180 It's all good working. 80 00:03:49,670 --> 00:03:54,260 Now, let's add this bad boy here somewhere else. 81 00:03:55,130 --> 00:03:56,420 So formate calories. 82 00:03:56,430 --> 00:03:57,410 I'm just going to copy it. 83 00:03:57,860 --> 00:04:03,280 So we are going and I'm going to hold and I'm going to paste that here. 84 00:04:04,790 --> 00:04:09,310 Also, I can be able to select both of them to save it. 85 00:04:09,320 --> 00:04:13,550 Now, I should be able to see yet here is even the zero is with two decimal places. 86 00:04:13,730 --> 00:04:14,660 But let's test it out. 87 00:04:14,660 --> 00:04:21,410 So let's say salad is one one thousand two hundred thirty five point sixty five. 88 00:04:21,620 --> 00:04:22,250 Enter. 89 00:04:23,480 --> 00:04:24,480 Go back here. 90 00:04:24,520 --> 00:04:25,670 Here is the comma. 91 00:04:25,820 --> 00:04:28,380 Here is the two decimal spaces in this ugly here. 92 00:04:28,460 --> 00:04:30,980 Even here, it's a little bit overflowing. 93 00:04:31,160 --> 00:04:32,570 That's why I'm going to round it up. 94 00:04:34,070 --> 00:04:40,550 Let's test for the exercise room one. 95 00:04:41,030 --> 00:04:45,080 We're going to use the same one for now, a little bit less. 96 00:04:47,030 --> 00:04:47,990 It's not possible yet. 97 00:04:48,020 --> 00:04:51,650 Burn that it's going it's looking very promising. 98 00:04:51,800 --> 00:04:55,690 So if you click on exercise, you should give you that one, the minus. 99 00:04:56,020 --> 00:04:57,010 OK, nice. 100 00:04:57,320 --> 00:04:59,810 So what else we need to do here? 101 00:04:59,840 --> 00:05:00,920 Because I use sixty five. 102 00:05:00,920 --> 00:05:01,400 Sixty five. 103 00:05:01,400 --> 00:05:03,110 That's why it's here, the whole thing. 104 00:05:03,110 --> 00:05:10,670 So if I add for example if I run in, if I said one sixty five only now I have a different result. 105 00:05:10,970 --> 00:05:12,170 This guy here. 106 00:05:12,470 --> 00:05:13,650 OK, let's fix that one. 107 00:05:14,180 --> 00:05:19,910 So where are we going to call this one, you know in here in this display front calories. 108 00:05:20,180 --> 00:05:22,160 But the remaining aegeus here. 109 00:05:22,160 --> 00:05:24,980 So we have the remaining in this if OK. 110 00:05:24,980 --> 00:05:25,850 Yeah, here it is. 111 00:05:25,850 --> 00:05:27,320 I use only one here. 112 00:05:28,820 --> 00:05:30,350 I was trying to do something. 113 00:05:30,470 --> 00:05:31,520 I'm just going to remove it. 114 00:05:31,520 --> 00:05:31,900 Right. 115 00:05:33,860 --> 00:05:35,930 Don't get critical here. 116 00:05:35,930 --> 00:05:37,460 Don't just judge me. 117 00:05:37,880 --> 00:05:39,980 I did try to do something. 118 00:05:39,980 --> 00:05:41,600 It didn't work the first time. 119 00:05:41,600 --> 00:05:47,840 So I'm just going to hold the I select something else all the old and like that one and I'm going to 120 00:05:47,840 --> 00:05:51,920 say format remaining OK in here. 121 00:05:53,720 --> 00:05:55,040 I'm just going to close all of them. 122 00:05:55,040 --> 00:05:56,030 So that's it. 123 00:05:56,240 --> 00:05:58,670 That's the beauty of holding out now. 124 00:05:59,090 --> 00:06:00,290 Here it is. 125 00:06:00,890 --> 00:06:03,440 So I hope when we put decimals now it's going to work. 126 00:06:03,980 --> 00:06:11,840 So let's food one one thousand three hundred twenty five point fifty sixty five enter. 127 00:06:14,070 --> 00:06:24,090 It is no decimal, even if you do some other crazy exercise like one and let's say here thirty eight 128 00:06:25,470 --> 00:06:30,210 and say exercise, click, exercise, enter, and that's pretty much it. 129 00:06:30,960 --> 00:06:38,660 Let's go back here and we do have this nicely formatted number when we when we have like thousands with 130 00:06:38,670 --> 00:06:39,120 a comma. 131 00:06:39,270 --> 00:06:39,660 Right. 132 00:06:40,080 --> 00:06:41,700 Cuz everything is working. 133 00:06:42,000 --> 00:06:46,990 I hope you had a good day and I will see you in the next hour. 134 00:06:47,100 --> 00:06:53,640 Just wait, let me just delete things and see if everything is back to normal, ok. 135 00:06:53,670 --> 00:06:54,000 Yeah. 136 00:06:55,800 --> 00:06:57,240 And I'm going to delete that one. 137 00:06:58,560 --> 00:06:59,060 That one. 138 00:07:00,090 --> 00:07:01,710 You know why gave us that result. 139 00:07:01,710 --> 00:07:04,300 Because we're doing absolute things, ok. 140 00:07:04,440 --> 00:07:05,010 Doesn't matter. 141 00:07:05,490 --> 00:07:09,060 Now that's pretty much it for this lecture. 142 00:07:09,520 --> 00:07:13,550 I'm not going to delete all of this just so you can comment the console. 143 00:07:13,590 --> 00:07:14,330 OK, that's it. 144 00:07:14,340 --> 00:07:17,450 Maybe I'll do it in a final lecture for the next lecture. 145 00:07:17,470 --> 00:07:19,080 I will see what we will do. 146 00:07:19,590 --> 00:07:24,720 We have a couple of things left, some short I mean, small things. 147 00:07:25,110 --> 00:07:27,210 They will be short, shorter lectures. 148 00:07:27,210 --> 00:07:29,220 But yeah, we need to do them as well. 149 00:07:29,410 --> 00:07:30,090 So thank you very much. 150 00:07:30,090 --> 00:07:33,300 I hope I will see you in the next one and enjoy.