by
82k 42
3
7
4,304
1
Top 1% !
Popular
Famous
Tagged
Easy-to-find
Specified
OpenSource
Popularity: 2486th place

Published on:

Languagetypescript
LicenseMIT_X11
MacOS Version10.7.5
OSMac OS X

Defininig arrays using templates in Typescript

You can now define an array using the template feature in Typescript. Be aware this way to build array is just a compile time 'type annotation' used to check type validity when using the array.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/24676/Defininig-arrays-using-templates-in-Type?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
class MyItemClass { ... } // Define an array for MyItemClass var itemArray : Array<MyItemClass>; ... var item : MyItem = itemArray[3];
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus