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 array elements alphabetically to ('W','X','Y'). The unshift function adds 'Z' at the beginning of the array, making it ('Z','W','X','Y'). Printing $array[0] outputs 'Z', the first element after unshift adds it to the front.