Examples getFirstValue([1, 2, 3]) ➞ 1
getFirstValue([80, 5, 100]) ➞ 80
Examples getFirstValue([1, 2, 3]) ➞ 1
getFirstValue([80, 5, 100]) ➞ 80
What language are you working in? The syntax will change slightly depending on the specific language, but most of the popular languages allow you to access elements in a list/array like this: aList[0] where 0 indicates the first element of the list. If you are working in python, for example, the function definition would look like this
def getFirstValue(aList):
return aList[0]