The new keyword

In JavaScript, you can create a new instance of an object or struct without using the new keyword. In C#, using new is mandatory.

JavaScript:

var myPosition = Vector3(0,0,0);
var myInstance = MyClass();
//We can also use new keyword in JavaScript
var myInstance = new MyClass();

C#:

Vector3 myPosition = new Vector3(0,0,0);
MyClass myInstance = new MyClass(); 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.59