33.2k views
7 votes
Question 7 Consider the following code:

const print = (value) => {
console.log(value);
}
var fruit = [
{id: 1, name: "Orange", price:40.0},
{id: 2, name:"Apple", price:30.0},
{id: 3, name: "Banana", price:10.0},
{id: 4, name: "Melon", price: 150.0},
{id: 5, name: "Apricots", price:40.0}
]
var list = fruit.filter( function(item){
return item.price >= 60.0; });
print(list[0].name);

Select the correct answer:
print function prints {id: 1, name: 'Orange, price: 40 }
String Melon is printed
Error is thrown
None of the above.

Question 7 Consider the following code: const print = (value) => { console.log-example-1
User Crobicha
by
8.5k points

1 Answer

3 votes

Answer:

Melon

Step-by-step explanation:

The variable "list" containts a function that returns a price that is greater than or equal to 60.0.

In the variable "fruit", the only item in the array with a price attribute set above that number is the string Melon.

User OshoParth
by
9.1k points

Related questions

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.