2
How do I take an array in Jquery that has for example 3 numeric values and recreate it with 3 new values?
2
How do I take an array in Jquery that has for example 3 numeric values and recreate it with 3 new values?
3
Using the function map()
. No need to use jQuery for this.
Take an example, there is one 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);
Browser other questions tagged javascript jquery
You are not signed in. Login or sign up in order to post.
Present the context better. And, show the code you are trying to execute, so it is easier to understand your problem and answer clearly.
– Samuel Fontebasso
The question is not clear, which logic for 3 new values?
– BrTkCa