Confused about this const usage

Hi, so I’m learning a bit about ES6, and I’m confused about const newArray in the code below.

const array = [1, 2, 3, 50];

const double = [];
const newArray = array.forEach((num) => {
	double.push(num * 2);
})

console.log(double);

I understand what this code does, and the ES6 arrow syntax, but I’m confused about what newArray actually is after this is run. If I run this code, it returns a doubled array in double, but then newArray is unidentified. It has no value, and it’s not a function, I’m confused. The code would run the same without it:

const double = [];
array.forEach((num) => {
	double.push(num * 2);
})

Can someone help me understand why we assign this constant?

where did you finf this?

assigning forEach() returned value doesn’t make sense, as it just returns undefined

if you used something like map() to create the double variable then it would make sense to assign the returned value of the method

On a Udemy course, he reviews the forEach loop with this example before talking about map(), but he never explains anything about why he assigned it. I guess out of habit using map()?

It makes me feel so much better knowing that it doesn’t make sense. So much wasted time trying to figure it out though…