-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprototype.html
50 lines (40 loc) · 949 Bytes
/
prototype.html
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">
//aviao
//atributos cor e modelo, método levantarVoo
//objeto literal
let a1 = {
cor: 'Branco',
modelo: 'Airbus a380',
levantarVoo: function() {console.log('Levantar voo')}
}
//função construtora
let AviaoF = function (){
this.cor = 'Azul',
this.modelo = 'Boeing 787',
this.levantarVoo = function() {console.log('Levantar Voo')}
}
let a2 = new AviaoF()
//classe
class AviaoC{
constructor(){
this.cor = 'Vermelho',
this.modelo = 'Embraer E-Jets'
}
levantarVoo() {
console.log('Levantar Voo')
}
}
let a3 = new AviaoC()
console.log(a1)
console.log(a2)
console.log(a3)
</script>
</head>
<body>
</body>
</html>