FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TypeScriptSamples/simple/animals.ts at master · dkukol/TypeScriptSamples · GitHub
dkukol
TypeScriptSamples
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
TypeScriptSamples
/
simple
/
animals.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (22 loc) · 457 Bytes
Breadcrumbs
TypeScriptSamples
/
simple
/
animals.ts
Copy path
File metadata and controls
26 lines (22 loc) · 457 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class
Animal
{
constructor
(
public
name
)
{
}
move
(
meters
)
{
alert
(
this
.
name
+
" moved "
+
meters
+
"m."
)
;
}
}
class
Snake
extends
Animal
{
move
(
)
{
alert
(
"Slithering..."
)
;
super
.
move
(
5
)
;
}
}
class
Horse
extends
Animal
{
move
(
)
{
alert
(
"Galloping..."
)
;
super
.
move
(
45
)
;
}
}
var
sam
=
new
Snake
(
"Sammy the Python"
)
var
tom
:
Animal
=
new
Horse
(
"Tommy the Palomino"
)
sam
.
move
(
)
tom
.
move
(
34
)
Back
|
FazBrowse Home
|
New Git URL