How to Rebuild an Array with New Values

2

How do I get an array in Jquery that has for example 3 numerical values and recreates it with 3 new values?

    
asked by anonymous 27.10.2017 / 13:40

1 answer

3

Using the % . You do not need to use jQuery for this.

See an example, there is a array with three items and a new array with the square of these items.

const array = [2, 3, 4];

const quadrados = array.map((item) => item * item);

console.log(quadrados);
    
27.10.2017 / 13:43