The below Javascript map method example will print out each number in an array after each number within that array has been multiplied by itself.
let data = [2, 4, 5, 6]; let data_revise = data.map(x => x * x); console.log(data_revise);
The numbers in the data array remain unchanged because the map method will only generate another array and assigned it to the data_revise variable.
The outcome is as follows:-
(4) [4, 16, 25, 36]
Which clearly indicated those numbers within that array have been multiplied by themselves.