first comit
This commit is contained in:
13
corrections/18-objet-methode.js
Normal file
13
corrections/18-objet-methode.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const personne = {
|
||||
nom: "Carole",
|
||||
age: 35,
|
||||
sePresenter: function() {
|
||||
console.log(`Bonjour, je m'appelle ${this.nom} et j'ai ${this.age} ans.`);
|
||||
}
|
||||
// Syntaxe alternative plus courte :
|
||||
// sePresenter() {
|
||||
// console.log(`Bonjour, je m'appelle ${this.nom} et j'ai ${this.age} ans.`);
|
||||
// }
|
||||
};
|
||||
|
||||
personne.sePresenter();
|
||||
Reference in New Issue
Block a user