- Expert Angular
- Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
- 110字
- 2021-07-15 17:05:30
Array
The array data type is meant to hold a collection of values of specific types. In TypeScript, we can define arrays in two ways, which are as follows:
var even:number[] = [2, 4, 6, 8, 10];
This statement declares an array variable of the number type using square brackets ([]) after the data type number, and it is assigned with a series of even numbers from 2 to 10. The second way to define array is as follows:
var even:Array<number> = [2, 4, 6, 8, 10];
This statement uses the generic array type, which uses the Array keyword followed by angle brackets (<>) that wrap the number data type.
推薦閱讀
- LabVIEW Graphical Programming Cookbook
- 精通搜索分析
- 編寫高質量代碼:改善Python程序的91個建議
- SQL語言從入門到精通
- JavaScript前端開發與實例教程(微課視頻版)
- 游戲程序設計教程
- Reactive Programming With Java 9
- C語言程序設計
- Mastering openFrameworks:Creative Coding Demystified
- OpenCV 4計算機視覺項目實戰(原書第2版)
- Java并發編程之美
- PHP+MySQL動態網站開發從入門到精通(視頻教學版)
- JavaScript Unit Testing
- 軟技能2:軟件開發者職業生涯指南
- Perl 6 Deep Dive