Use "new" or not?

Hi all,

What is the difference between

and

Thanks in advance

There isn’t any difference, the “new” is there whether you write it or not.

–Eric

new keyword applies to C#. In C# whenever you wants to use a new class/struct, you need to specify the new keyword. Like new Vector3(0, 0, 0);
In javascript, you can omit it. It just is a keyword to call the constructor function in the designated class/struct.

It’s the same in JS and C#, it’s just optional in JS.

–Eric

Yeap. I was refering to C#. Seldom use js nowadays.

Got it, thanks, Eric5h5 and zine92.