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
| <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>JavaScript et Objets</title>
</head>
<body>
<script>
function Membre(id, nom, niveau) {
this.id = id;
this.nom = nom;
this.niveau = niveau;
}
function Team() {
}
var maTeam = new Team();
maTeam.add(new Membre(42, "Alice", "C"));
maTeam.add(new Membre(43, "Mickey", "C"));
maTeam.add(new Membre(44, "Baya", "C"));
maTeam.add(new Membre(45, "Firmin", "B"));
maTeam.add(new Membre(46, "Jean", "C"));
maTeam.add(new Membre(47, "Boris", "A"));
maTeam.add(new Membre(48, "Leïla", "C"));
maTeam.add(new Membre(49, "Souleymane", "B"));
document.writeln(maTeam);
</script>
</body>
</html> |
Partager