# Self-review: Create a basic List component - Advanced React

1. **When using the** `filter` **operator from arrays in JavaScript, what type should you return from the predicate function to determine if the element should be filtered out or not?**
    
    * You should return `null` if the element should be filtered out and any other value to keep the element.
        
    * <mark>You should return </mark> `true` <mark>to keep the element and </mark> `false` <mark>to filter out the element.</mark>
        
    * You should return `undefined` to filter out the element and `true` to keep it in the list.
        
2. **When chaining the three array operators required to complete the exercise,** `map`**,** `filter` **and** `sort`**; in which order should they be applied to** `props.data`**? Remember that** `props.data` **contains an array of dessert objects.**
    
    * * Sort, filter, map.
            
            * Map, filter, sort.
                
            * <mark>Filter, sort, map.</mark>
                
3. **When using the** `map` **function to transform an array item into a** `<li>` **element, what of the following code snippets should be inside the** `<li>` **tag to render the list item correctly in the following format:** `Ice Cream - 200 cal`
    
    * &lt;li&gt;${dessert.name} - ${dessert.calories} cal&lt;/li&gt;
        
    * &lt;li&gt;dessert.name - dessert.calories + “cal”&lt;/li&gt;
        
    * <mark>&lt;li&gt;{dessert.name} - {dessert.calories} cal&lt;/li&gt;</mark>
        

---

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724056951481/190f1d3a-139e-45e8-abdd-993c28b85d3d.png align="center")
