Basics
Challenges
Classes
Debugging
Events
External Files
Flow Control
Forms
Functions
Html Elements
Installation
Interfaces
Keywords
Modules
Namespaces
Operators
Reference Files
String
Types
Notice the difference here. Method 1 is standard. Method 2 differs a little that it would from c#.
Notice that you instantiate the anonymous object, you do not use the new
keyword like you would
with c#. You also use a colon instead of a equal operator.
// method 1
let thing1 = new Thing();
thing1.Property1 = "Foo";
thing1.Property2 = "Bar";
thing1.Property3 = "undecided";
// method 2
let thing2: Thing =
{
Property1: "Foo2",
Property2: "Bar2",
Property3: "undecided2",
};
// c# method
Spaceship oSpaceship = new Spaceship()
{
PassengerCapacity = 10,
RequiredCrew = 5
};