Supplement and assess your coding journey with multiple choice questions.
Given an array of integers,
arr = [1, 2, 3, 4], which of the following statements will not return the first element,
The relevant setup information along with the question is the question. The four options are the alternatives. Three of the alternatives are incorrect and therefore distractors. And
arr(1) is correct and therefore the key. The entire example is the stem.
My intention in crafting this stem was to expose the lesser known
#at() method. I chose not to include another choice like
arr[-4] because I prefer to limit the choices to four, and given the obscure nature of both
arr.at(0), only one ought to be exposed as the learning opportunity. A second, sequential stem could follow to build upon learning the obscure means of accessing array elements.