Kingston_Pendrive/Suli/13.b/Frontend/Javascript/2024. 11. 04/index.html
2024-11-19 19:04:02 +01:00

65 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
let car = {
name: "Fiat",
model: "500",
start: function () {
return "Autó elindul!";
},
drive: function () {
return "Autó megy!";
}
}
//---------------------------------------------------
class Szemely{
static faj = "Ember";
nev = "Sanyi";
kor = 12;
}
let szemely1 = new Szemely();
console.log(Szemely.faj);
//---------------------------------------------------
class Ember{
constructor(nev, kor){
this.nev = nev;
this.kor = kor;
}
}
let ember1 = new Ember("Sanyi", 12);
console.log(ember1.nev);
//---------------------------------------------------
class Valaki{
constructor(nev, kor){
this._nev = nev;
this._kor = kor;
}
}
let valaki1 = new Valaki("Péter", 22);
console.log(valaki1._nev);
//---------------------------------------------------
class Vki{
constructor(nev, kor){
this.nev = nev;
this.kor = kor;
}
static udvozles(){
return "Üdvözöllek!";
}
}
let vki1 = new Vki("Péter", 22);
console.log(Vki.udvozles());
</script>
</body>
</html>