Javascript: Multiply array elements by a number and store result to a new array
If I have:
const arr = [1, 2, 3, 4];
const n = 5;
const result = [6, 1, 7, 0]; // 1234 * 5
How do I get result?
If I have:
const arr = [1, 2, 3, 4];
const n = 5;
const result = [6, 1, 7, 0]; // 1234 * 5
How do I get result?
We use cookies to ensure the best experience on our website. This includes analytics, personalization, and marketing purposes. Some cookies are essential for the website to function properly.
By clicking "Accept", you consent to our use of cookies. You can read more about how we use cookies and how you can change your preferences in our Privacy Policy.