Starting Small explainer


The aim of this puzzle: Remove the first 2 elements from the array.

Walkthrough of the solution: The televisions variable is an array of objects. If you wanted to remove one from the array, you could use .pop(), but that would take it from the end of the array. If you want to “pop” off the 1st element, you can use .shift() instead.

The starter code already shifts off the 1st element and prints it out. The original array is now 1 item smaller. To remove and print the new 1st element, you can use televisions.shift() and put that inside of printTV().

Sample code solution:
(Tap below to reveal)

import { televisions } from '';

function printTV(tv) {
  console.log(tv.size + ' for $' + tv.price);

console.log('The smallest TV:');
console.log('The next smallest TV:');

JavaScript Concepts: Binary Expression (+ concatenation), console.log(), .forEach(), import, .shift()