Get first n elements of an array

Write a function that takes an array (a) as argument. Extract the first 3 elements of a. Return the resulting array
JavaScript
Console