# Knowledge check: Error handling in Javascript

1. **What will be printed when the following code runs?**
    
    ```javascript
    var result = null;
    console.log(result);
    ```
    
    * undefined
        
    * <mark>null</mark>
        
    * 0
        
2. **When the following code runs, what will print out?**
    
    ```javascript
    try {
      console.log('Hello');
    } catch(err) {
      console.log('Goodbye');
    }
    ```
    
    * <mark>Hello</mark>
        
    * Goodbye
        
3. **If you pass an unsupported data type to a function, what error will be thrown?**
    
    * RangeError
        
    * SyntaxErrror
        
    * <mark>TypeError</mark>
        
4. **What will print out when the following code runs?**
    
    ```javascript
    var x;
    
    if(x === null) {
      console.log("null");
    } else if(x === undefined) {
      console.log("undefined");
    } else {
      console.log("ok");
    }
    ```
    
    * null
        
    * <mark>undefined</mark>
        
    * ok
        
5. **What will print out when the following code runs?**
    
    ```javascript
    throw new Error();
    console.log("Hello");
    ```
    
    * Hello
        
    * <mark>Nothing will print out.</mark>
