# Knowledge check: Arrays, Objects and Functions in Javascript

1. What data type is the variable item ?
    
    ```javascript
    var item = [];
    ```
    
    * Boolean
        
    * Function
        
    * <mark>Array</mark>
        
2. **What is the value of result for the following code?**
    
    ```javascript
    var result = "Hello".indexOf('l');
    ```
    
    * 1
        
    * 2
        
    * 3
        
    * 4
        
3. **What is the length of the clothes array after this code runs?**
    
    ```javascript
    var clothes = [];
      clothes.push('gray t-shirt');
      clothes.push('green scarf');
      clothes.pop();
      clothes.push('slippers');
      clothes.pop();
      clothes.push('boots');
      clothes.push('old jeans');
    ```
    
    * 1
        
    * 2
        
    * <mark>3</mark>
        
    * 4
        
4. **What value is printed out by the following code?**
    
    ```javascript
    var food = [];
    food.push('Chocolate');
    food.push('Ice cream');
    food.push('Donut');
    
    console.log(food[1])
    ```
    
    * Chocolate
        
    * <mark>Ice cream</mark>
        
    * Donut
        
5. **How many properties does the dog object have after the following code is run?**
    
    ```javascript
    var dog = {
        color: "brown",
        height: 30,
        length: 60
    };
    dog["type"] = "corgi";
    ```
    
    * 1
        
    * 2
        
    * 3
        
    * <mark>4</mark>
        
6. **In the following function, the variables a and b are known as \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_.**
    
    ```javascript
    function add(a, b) {
          return a + b;
    }
    ```
    
    * <mark>Parameters</mark>
        
    * Return Values
        
7. **Which of the following are functions of the Math object?**
    
    * <mark>random()</mark>
        
    * round()
        
    * sqrt()
        
    * trim()
