1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-11 09:14:39 +02:00

fix spacing issue

This commit is contained in:
Nolan Prescott
2015-03-10 16:58:18 -05:00
parent 394e7ecb84
commit 69480d51b8

View File

@@ -43,10 +43,10 @@ function bigHorribleAlert(): void {
// The following are equivalent, the same signature will be infered by the // The following are equivalent, the same signature will be infered by the
// compiler, and same JavaScript will be emitted // compiler, and same JavaScript will be emitted
var f1 = function(i: number) : number { return i * i; } var f1 = function(i: number): number { return i * i; }
// Return type inferred // Return type inferred
var f2 = function(i: number) { return i * i; } var f2 = function(i: number) { return i * i; }
var f3 = (i: number) : number => { return i * i; } var f3 = (i: number): number => { return i * i; }
// Return type inferred // Return type inferred
var f4 = (i: number) => { return i * i; } var f4 = (i: number) => { return i * i; }
// Return type inferred, one-liner means no return keyword needed // Return type inferred, one-liner means no return keyword needed
@@ -64,11 +64,11 @@ interface Person {
// Object that implements the "Person" interface // Object that implements the "Person" interface
// Can be treated as a Person since it has the name and move properties // Can be treated as a Person since it has the name and move properties
var p : Person = { name: "Bobby", move : () => {} }; var p: Person = { name: "Bobby", move: () => {} };
// Objects that have the optional property: // Objects that have the optional property:
var validPerson : Person = { name: "Bobby", age: 42, move: () => {} }; var validPerson: Person = { name: "Bobby", age: 42, move: () => {} };
// Is not a person because age is not a number // Is not a person because age is not a number
var invalidPerson : Person = { name: "Bobby", age: true }; var invalidPerson: Person = { name: "Bobby", age: true };
// Interfaces can also describe a function type // Interfaces can also describe a function type
interface SearchFunc { interface SearchFunc {