javascript select first item in ara code example
Example 1: javascript select first n elements from array
const array = ['toto','tata','titi','tutu'];
array.slice(0, 2); // => ['toto','tata']
Example 2: javascript select first element
// example:
document.querySelector('.message')
// syntax:
// document.querySelector('.<class-name>')