Multiple choice technology programming languages

Consider the following program code @array= (“Y”,”W”,”X”); @array=sort(@array); unshift(@array , ”Z”); print($array[0]); What is the output of this code

  1. W

  2. X

  3. Y

  4. Z

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

The sort function arranges the elements in alphabetical order, producing ('W', 'X', 'Y'). The unshift operation then adds 'Z' to the beginning of the array, making it the first element at index 0. Therefore, printing $array[0] displays 'Z'.