JS
challenger
Home
JavaScript Practice
JavaScript arrays
Get first n elements of an array
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
Premium
reset
function greet(name) { return `Hello, ${name}!`; } console.log(greet("Erik"));
JavaScript
Run Code
Console