So we've only just begun javascript and it's already time for our first quick problem set.
So there are three challenges here and I'd like for you to try to do them without any code without running
them in the browser and the console.
That's not the point here.
What really we're trying to do is check for your conceptual understanding of the percentage sign or
the plus sign between two strings or the square brackets or link and the double backslash.
So go ahead and try evaluating these mentally and pause video and then following this we'll have solutions
.
OK so I'm going to go ahead and start discussing the first problem here.
So 100 maade three modules over remember is the remainder operator.
So we divide three into 100 as many times as he can go in.
So that is going to be 33 times.
And then we subtract 33 times three which is ninety nine from 100 and we get 1.
So divide 3 in as many times as possible and then take the remainder.
So that should be 1.
So if we want to run this in our council we can go ahead and do 100 maade 3 and we get 1.
All right.
So let's move on to the second one now.
We have the string blah that is being added to another string blah.
Remember that's called concatenation.
And because we have the parentheses around it that will happen first.
So that's basically the equivalent of running law plus law which will just give us blah blah no space
and then we're adding the square brackets onto that character 6.
So that's going to be the sixth index which is actually the seventh character because it starts 0.
So we would end up with 0 1 2 3 4 5 6 the letter A.
And that's what we get just to verify.
I'll just run the entire line.
Great.
And we get the letter A.
So let's move on to the final one here.
So this one's a little bit trickier.
It actually combines numbers and strings together in one expression here.
So we start just on the left side.
Hello hotlink.
So that's going to be one two three four five.
So we end up with five books modulo And then this one is even trickier because it looks like it's four
characters length on those four characters.
But in actuality when we run this string and I hit enter it comes back to me as just three characters
and that's because we're escaping this backslash.
Just like if I did backslash double quote The backslash goes away and we end up with our double quote
inside.
So if we evaluate this we end up with five maade three.
And that of course three goes into five one time with the remainder of two.
So if we try that out we should get two.
And we do.
OK.
So hopefully you enjoy those super quick exercises very soon.
These exercises will then become making a tic tac toe game making a blog app all sorts of fun things
using javascript.
But we have to start small