If we want to add a constant value to each element in an array(assuming the array contains numbers), we can use the ‘map’ method.
const array = [1, 2, 3, 4];
const constantValue = 7;
const newArray = array.map(element => element + constantValue);
console.log(newArray); // Output: [8, 9, 10, 11]