# Knowledge check: Advanced JavaScript Features

1. **What will print out when the following code runs?**
    
    ```javascript
    const meal = ["soup", "steak", "ice cream"]
    let [starter] = meal;
    console.log(starter);
    ```
    
    * <mark>soup</mark>
        
    * ice cream
        
    * steak
        
2. **The for-of loop works for Object data types.**
    
    * true
        
    * <mark>false</mark>
        
3. **What will print out when the following code runs?**
    
    ```javascript
    let food = "Chocolate";
    console.log(`My favourite food is ${food}`);
    ```
    
    * <mark>My favourite food is Chocolate</mark>
        
    * My favourite food is ${food}
        
4. **What values will be stored in the set collection after the following code runs?**
    
    ```javascript
    let set = new Set();
    set.add(1);
    set.add(2);
    set.add(3);
    set.add(2);
    set.add(1);
    ```
    
    * 1, 2, 3, 2, 1
        
    * <mark>1, 2, 3</mark>
        
5. **What value will be printed out when the following code runs?**
    
    ```javascript
    let obj = {
        key: 1,
        value: 4
    };
    
    let output = { ...obj };
    output.value -= obj.key;
    
    console.log(output.value);
    ```
    
    * 1
        
    * 2
        
    * <mark>3</mark>
        
    * 4
        
6. **What value will be printed out when the following code runs?**
    
    ```javascript
    function count(...basket) {
        console.log(basket.length)
    }
    
    count(10, 9, 8, 7, 6);
    ```
    
    * 10, 9, 8, 7, 6
        
    * 1, 2, 3, 4, 5
        
    * 6
        
    * <mark>5</mark>
