Anonymous Type Article Index for
Anonymous
Website Links For
Anonymous
 

Information About

Anonymous Type




This feature should not be confused with Dynamic Typing . While anonymous types allow programmers to define fields seemingly "on the fly", they are still static entities. Type checking is done at compile time, and attempting to access a nonexistent field will cause a compiler error. This gives programmers much of the convenience of a dynamic language, with the type safety of a Statically Typed Language .


EXAMPLE (C#)


var person = new {FirstName = "John", LastName = "Smith"}


EXAMPLE (CHROME)


var person := new class(FirstName := 'John', LastName := 'Smith');


SEE ALSO



REFERENCES