Border elements in JavaScript

shiftpoppushunshift
Задание 1

Given the following array:

javascript[1, 2, 3]

Display the first element of this array.

Задание 2

Given the following array:

javascript[1, 2, 3]

Display the last element of this array.

Задание 3

Given the following array:

javascript[1, 2, 3]

Add the elements 4, 5, 6 to its end.

Задание 4

Given the following array:

javascript[1, 2, 3]

Add the elements 4, 5, 6 to its start.