Array and Object Literal Types
dhtmlkitchen at gmail.com
Fri Aug 17 14:47:43 PDT 2007
It would be nice to have Array literal syntax declare it's ArrayType
before the declaration of the array.
1. var x : Array<String> = [ "foo", "bar", document.title, getAnotherString() ];
2. var x = [ "foo", "bar", document.title, getAnotherString() ] : String;
example 1 is more clear to read because in a long array, you'd see
right away what type of Array it is.
Is the former syntax (or some variant thereof) going to be available?
What about for Objects?
More information about the Es4-discuss