Ruby program to get the first item from the array

bookmark

arr = [100,101,102,103,104];
item = arr.first();

print "Array: ",arr,"\n";
print "first item: ",item,"\n";


Output:

Array: [100, 101, 102, 103, 104]
first item: 100