How do I get an array in Jquery that has for example 3 numerical values and recreates it with 3 new values?
How do I get an array in Jquery that has for example 3 numerical values and recreates it with 3 new values?
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);