// Practice Set · JS Arrays · guest

Guest practice: this set is not saved and does not count.

Question 1 of 5 from: JS Array Methods

delete nums[1] removes the element at index 1 and makes the array one shorter.

Question 2 of 5 from: JS Array Sort

What does this log?

console.log([10, 9, 1, 100, 25].sort());
Question 3 of 5 from: JS Array Iterations

What does this log?

const orders = [
  { item: "Lamp", price: 24, shipped: true },
  { item: "Desk", price: 180, shipped: false },
  { item: "Chair", price: 95, shipped: true }
];
console.log(orders.filter(o => o.shipped).map(o => o.price).reduce((sum, p) => sum + p, 0));
Question 4 of 5 from: JS Array const

With const queue = ["a", "b", "c"];, the line queue.length = 0; is allowed and empties the array.

Question 5 of 5 from: JS Array const

Object.freeze([{ n: 1 }])[0].n = 2 works: freezing an array does not freeze the objects inside it.

Ready to submit?

Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.