In JavaScript, the .map() method allows you to create a new array by returning the results of calling a function that you provide on every element in a given array.
constnumbers=[1,2,3,4,5]constsquared=numbers.map((num)=>num*num)console.log(squared)