Example of how to use Number in Typescript (#20802)

* Example of how to use Number in Typescript

* updated with changes suggested in review

* updated indent in code block

* updated based on @itaisteinherz suggestions
This commit is contained in:
Patryk Buda
2018-11-15 01:39:19 +00:00
committed by Christopher McCormack
parent cf44c7246d
commit d3d6d57618

View File

@ -12,4 +12,22 @@ let decimal: number = 7;
let hex: number = 0xf00d;
let binary: number = 0b0110;
let octal: number = 0o531;
```
```
Example of Number type usage in TypeScript:
```typescript
class Employee extends Person {
age: Number;
constructor(age: Number){
// Calls constructor of Person
super();
this.age = age;
}
getAge(): Number {
return this.age;
}
}
```