Multiple choice technology testing

What is the keyword that is used to retain the previous values, when we redim a dynamic array to different sizes?

  1. Redim Retain arr(s)

  2. Redim Preserve arr(s)

  3. Redim Persist arr(s)

  4. Redim CarryForward arr(s)

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

In VBScript, when you resize a dynamic array using Redim, the existing values are normally lost. The Preserve keyword retains the existing values when resizing. Redim Retain, Persist, and CarryForward are not valid VBScript keywords for this purpose.