When using the
filteroperator 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
nullif the element should be filtered out and any other value to keep the element.You should return
trueto keep the element andfalseto filter out the element.You should return
undefinedto filter out the element andtrueto keep it in the list.
When chaining the three array operators required to complete the exercise,
map,filterandsort; in which order should they be applied toprops.data? Remember thatprops.datacontains an array of dessert objects.Sort, filter, map.
Map, filter, sort.
Filter, sort, map.
When using the
mapfunction 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<li>${dessert.name} - ${dessert.calories} cal</li>
<li>dessert.name - dessert.calories + “cal”</li>
<li>{dessert.name} - {dessert.calories} cal</li>

