Skip to content

Quiz: Arrays

2 min read

1. If an array is declared as int scores[5], what are the valid indices?

Show hint

Arrays in Sanny Builder are zero-based, and the number in brackets is the total number of elements.

2. What does the spread operator (...) do when used with an array?

Show hint

Think about how you'd pass three coordinates (x, y, z) stored in an array to a command that expects three separate parameters.

3. What happens if you access an array with an index that is out of bounds?

Show hint

There are no runtime bounds checks in GTA scripting.