Skip to main content
/
Group intelligence
/
Contents contributed and discussions participated by Cédric Lampron
Contents contributed and discussions participated by
Cédric Lampron
Simple
Middle
Filter:
All
|
Bookmarks
|
Topics
TypeScript
- 2 views
TypeScript
started by
Cédric Lampron
on 08 Jun 15
no follow-up yet
#1
Cédric Lampron
on 08 Jun 15
TypeScript
...
Cancel
| The Definitive TypeScript Guide | Blog | SitePen
- 1 views
www.sitepen.com/...definitive-guide-to-typescript
TypeScript
shared by
Cédric Lampron
on 08 Jun 15
-
No Cached
optional parameters, default argument values, rest parameters, and fat arrow functions
Cédric Lampron
on 08 Jun 15
Default : "exclusive?"
Default : "exclusive?"
...
Cancel
...
Cancel
Optional parameters can now be defined by suffixing a parameter identifier with a question mark:
...
Cancel
An optional parameter
...
Cancel
...9 more annotations...
123function getRange(max, min = 0, exclusive = false) { // ...}
Cédric Lampron
on 08 Jun 15
Optional Parameter
Optional Parameter
...
Cancel
...
Cancel
ypeScript also adds support for a final variadic ...rest parameter, which collects any extra arguments passed to the function into a single named array:
...
Cancel
23function publish(topic, ...args):void { // ...}
Cédric Lampron
on 08 Jun 15
calling publish('/foo', 'a', 'b', 'c') would cause topic to be a string '/foo' and args to be an array [ 'a', 'b', 'c' ].
calling publish('/foo', 'a', 'b', 'c') would cause topic to be a string '/foo' and args to be an array [ 'a', 'b', 'c' ].
...
Cancel
...
Cancel
12var x, y;[x, y] = [10, 20];
...
Cancel
any, number, string, boolean, and void (i.e. null or undefined)
...
Cancel
TypeScript allows complex types
...
Cancel
the properties of each object are compared
...
Cancel
interface IPoint { x: number; y: number;} var point: IPoint;var point2: IPoint;
...
Cancel
interface IPoint3d extends IPoint { z: number;}
...
Cancel
...
Cancel
Floating point - Wikipedia, the free encyclopedia
- 1 views
en.wikipedia.org/...Floating_point
shared by
Cédric Lampron
on 20 May 15
-
Cached
Cédric Lampron
on 20 May 15
http://stackoverflow.com/questions/588004/is-floating-point-math-broken
http://stackoverflow.com/questions/588004/is-floating-point-math-broken
...
Cancel
Cédric Lampron
on 20 May 15
0.1 + 0.2 -> 0.30000000000000004
0.1 + 0.2 -> 0.30000000000000004
...
Cancel
...
Cancel
...
Cancel
1
-
3
of
3
Showing
20
▼
items per page
20
50
100
Cédric Lampron