Welcome back.
So now we're going to look at the solution for the Section three challenge, and so we're going to do
this code together.
So let's start with the variables that we said we'd start with for Fido and Whiskers.
Let's do Fido H.
Equals 12 and let's do a let Fido equal 12.
And this is Fido.
OK, and let's let Whiskers H equal nine.
And that's four whiskers the cat.
And now we're going to store the variable, the number seven as dog years.
So let's let dog years equal.
Oops equals seven and then let's let cat years equal five.
OK, so now we're going to calculate how old these animals are in human years, so how do we do that?
So we would say, Fido, let's to let Fido human years
equal.
Fido, aged times, dog years.
OK, so that would be 12 times seven.
OK, so 12 times seven, we can do our math in our head.
That should be eighty four, OK?
And then we can let whiskery let whiskers human ears,
equal whiskers, age times, cat ears.
OK, which is a smaller nine times five.
So that would be forty five.
OK, so right off the bat you can see is 80 for bigger than forty five.
Yes.
Let's create a boolean to say whether or not Fido is older than whiskers.
So let's do.
But.
Is
Phyto older and then we can say that is phyto older, equal to and very simply, you can just say phyto
human years is greater than risk human ears.
OK, so this being a conditional expression is going to tell you A-T for greater than forty five is
eighty for greater than forty five.
If so, then the answer true will be stored in is phyto older.
So then all we need to do is print a string to the console with the boolean variable like this so we
can just console that log.
Is Feydeau older?
And then we can just put his fire older
right there and then let's see if it worked.
Let's make sure we go the right lesson, right is phyto older trip to not be so small there, we can
see how that fits on a single line.
OK, that is one solution to this challenge where you're going to state the variables.
We set the state do the math that we said to do the math for, do the comparison we wanted to do and
then just print that to the console just like so.
OK, and this is fine.
If it's a lower case, that's more accurate.
OK.
I will do that.
OK, so that is the result of the challenge and good job on Section three.
Next, we're going to move on to Section four and we're going to get into primitive data types and get
into lots of details around how strings work, how numbers work, how symbols and null and undefined
and booleans work in much more detail.
OK?
And we're also going to get into conditional operations if else statements, switch statements.
It's going to be a long section full of valuable stuff that we use every single day in JavaScript.
All right.
Thank you.
And we'll see you then.