1 00:00:00,570 --> 00:00:01,470 Welcome back. 2 00:00:01,500 --> 00:00:06,480 So now we're going to look at the solution for the Section three challenge, and so we're going to do 3 00:00:06,480 --> 00:00:07,350 this code together. 4 00:00:08,480 --> 00:00:12,330 So let's start with the variables that we said we'd start with for Fido and Whiskers. 5 00:00:13,380 --> 00:00:14,790 Let's do Fido H. 6 00:00:14,880 --> 00:00:19,990 Equals 12 and let's do a let Fido equal 12. 7 00:00:21,390 --> 00:00:23,360 And this is Fido. 8 00:00:24,060 --> 00:00:31,800 OK, and let's let Whiskers H equal nine. 9 00:00:33,240 --> 00:00:34,850 And that's four whiskers the cat. 10 00:00:37,110 --> 00:00:41,090 And now we're going to store the variable, the number seven as dog years. 11 00:00:41,130 --> 00:00:45,380 So let's let dog years equal. 12 00:00:45,650 --> 00:00:53,730 Oops equals seven and then let's let cat years equal five. 13 00:00:55,900 --> 00:01:06,330 OK, so now we're going to calculate how old these animals are in human years, so how do we do that? 14 00:01:07,390 --> 00:01:14,920 So we would say, Fido, let's to let Fido human years 15 00:01:17,650 --> 00:01:18,220 equal. 16 00:01:19,710 --> 00:01:25,260 Fido, aged times, dog years. 17 00:01:27,750 --> 00:01:31,950 OK, so that would be 12 times seven. 18 00:01:32,580 --> 00:01:35,820 OK, so 12 times seven, we can do our math in our head. 19 00:01:35,820 --> 00:01:38,760 That should be eighty four, OK? 20 00:01:39,660 --> 00:01:45,630 And then we can let whiskery let whiskers human ears, 21 00:01:48,510 --> 00:01:55,710 equal whiskers, age times, cat ears. 22 00:01:56,160 --> 00:02:01,800 OK, which is a smaller nine times five. 23 00:02:02,580 --> 00:02:03,930 So that would be forty five. 24 00:02:05,280 --> 00:02:10,560 OK, so right off the bat you can see is 80 for bigger than forty five. 25 00:02:11,040 --> 00:02:11,490 Yes. 26 00:02:12,770 --> 00:02:15,930 Let's create a boolean to say whether or not Fido is older than whiskers. 27 00:02:16,140 --> 00:02:16,920 So let's do. 28 00:02:19,560 --> 00:02:19,950 But. 29 00:02:22,730 --> 00:02:23,300 Is 30 00:02:26,120 --> 00:02:33,110 Phyto older and then we can say that is phyto older, equal to and very simply, you can just say phyto 31 00:02:33,110 --> 00:02:37,790 human years is greater than risk human ears. 32 00:02:39,290 --> 00:02:49,200 OK, so this being a conditional expression is going to tell you A-T for greater than forty five is 33 00:02:49,310 --> 00:02:50,960 eighty for greater than forty five. 34 00:02:51,440 --> 00:02:56,260 If so, then the answer true will be stored in is phyto older. 35 00:02:57,920 --> 00:03:04,940 So then all we need to do is print a string to the console with the boolean variable like this so we 36 00:03:04,940 --> 00:03:06,650 can just console that log. 37 00:03:10,860 --> 00:03:14,160 Is Feydeau older? 38 00:03:19,370 --> 00:03:23,570 And then we can just put his fire older 39 00:03:26,360 --> 00:03:30,410 right there and then let's see if it worked. 40 00:03:34,550 --> 00:03:44,420 Let's make sure we go the right lesson, right is phyto older trip to not be so small there, we can 41 00:03:44,420 --> 00:03:46,320 see how that fits on a single line. 42 00:03:46,730 --> 00:03:51,770 OK, that is one solution to this challenge where you're going to state the variables. 43 00:03:51,770 --> 00:03:58,640 We set the state do the math that we said to do the math for, do the comparison we wanted to do and 44 00:03:58,640 --> 00:04:01,850 then just print that to the console just like so. 45 00:04:02,250 --> 00:04:03,710 OK, and this is fine. 46 00:04:03,710 --> 00:04:05,570 If it's a lower case, that's more accurate. 47 00:04:06,110 --> 00:04:06,460 OK. 48 00:04:07,980 --> 00:04:08,810 I will do that. 49 00:04:10,610 --> 00:04:15,950 OK, so that is the result of the challenge and good job on Section three. 50 00:04:16,610 --> 00:04:21,770 Next, we're going to move on to Section four and we're going to get into primitive data types and get 51 00:04:21,770 --> 00:04:31,310 into lots of details around how strings work, how numbers work, how symbols and null and undefined 52 00:04:31,310 --> 00:04:34,970 and booleans work in much more detail. 53 00:04:35,360 --> 00:04:35,810 OK? 54 00:04:35,900 --> 00:04:41,050 And we're also going to get into conditional operations if else statements, switch statements. 55 00:04:41,060 --> 00:04:47,360 It's going to be a long section full of valuable stuff that we use every single day in JavaScript. 56 00:04:47,690 --> 00:04:48,050 All right. 57 00:04:48,680 --> 00:04:49,190 Thank you. 58 00:04:49,190 --> 00:04:49,940 And we'll see you then.