January 2018
Beginner
658 pages
13h 10m
English
Now we can also chain together multiple assertions. For example, we could assert that the value that comes back from add is a number. This can be done using another assertion. So let's head into the docs and take a look. Inside Chrome, we'll scroll down through the assertion docs list. There are a lot of methods. We'll be exploring some of them. In this case, we're looking for toBeA, the method that takes a string:

This takes the string type and it uses the typeof operator to assert that the value is of a certain type. Here we're expecting 2 to be a number. We can do that exact same thing over in our code. Inside ...
Read now
Unlock full access