Multiple choice technology

The ArrayList \$a will have which of the below items after executing the below script? \$a = New-Object System.Collections.ArrayList $a.Add("red") $a.Add("yellow") $a.Add("orange") $a.Add("green") $a.Add("blue") $a.Add("purple") $a.RemoveRange(3,3)

  1. red orange Purple

  2. Green blue Purple

  3. red yellow Green

  4. red yellow Orange

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

The ArrayList starts with red, yellow, orange, green, blue, purple. RemoveRange(3,3) removes 3 elements starting at index 3 (0-based): green, blue, and purple. This leaves red, yellow, orange - the first three items that were added before the removal range.