-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bb37f5
commit e38a214
Showing
6 changed files
with
212 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function pet(animal) { | ||
animal.numberOfPets++; | ||
animal.isAGoodBoy = true; | ||
} | ||
var fluffy = { | ||
name: 'fluffy', | ||
numberOfPets: 3, | ||
isAGoodBoy: false, | ||
legs: 4, | ||
wearingDiaper: true | ||
}; | ||
var stray = { | ||
numberOfPets: 0, | ||
isAGoodBoy: true, | ||
legs: 3 | ||
}; | ||
var dumbo = { | ||
name: 'dumbo', | ||
numberOfPets: 9000, | ||
peanuts: [ | ||
{ numberOfNuts: 2 }, | ||
{ numberOfNuts: 1.5 }, | ||
{ numberOfNuts: 1 } | ||
], | ||
legs: 4, | ||
trunk: 'long', | ||
isAGoodBoy: true, | ||
toot: function () { return console.log('TOOOOOT'); } | ||
}; | ||
pet(fluffy); | ||
pet(stray); | ||
pet(dumbo); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
interface Pettable { | ||
numberOfPets: number; | ||
isAGoodBoy: boolean; | ||
} | ||
|
||
function pet(animal: Pettable) { | ||
animal.numberOfPets++; | ||
animal.isAGoodBoy = true; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters