Array

Extract part of an array or a string (new array) -> slice()

const array = 'hello world';
const result = array.slice(0,5);
console.log(result); // hello

Remove part of an array (replace array) -> splice()

const array = ['h','e','l','l','o'];
const result = array.splice(0, 3);
console.log(result); // hel