Multiple choice technology programming languages

pop (@array);

  1. splice (@array, 0, 1);

  2. splice (@array, @array-1, 1);

  3. splice (@array, scalar(@array), 0, @sublist);

  4. splice (@array, 0, 0, @sublist);

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

pop() removes the last element from an array. splice(@array, @array-1, 1) does the same: it starts at the last index (@array-1) and removes 1 element. Option A removes the first element. Options C and D add elements rather than removing.