Horje
POO js Code Example
POO js
function Personne(nom) {
  this.nom = nom;
  this.salutation = function() {
    alert('Bonjour ! Je m\'appelle ' + this.nom + '.');
  };
}
POO js
var personne1 = new Personne('Bob');
var personne2 = new Personne('Sarah');
POO js
function creerNouvellePersonne(nom) {
  var obj = {};
  obj.nom = nom;
  obj.salutation = function() {
    alert('Salut ! Je m\'appelle ' + this.nom + '.');
  };
  return obj;
}
POO js
personne1.nom
personne1.salutation()
personne2.nom
personne2.salutation()




Javascript

Related
5.1.1. Boolean Values¶ Code Example 5.1.1. Boolean Values¶ Code Example
jquey datatables Code Example jquey datatables Code Example
asasa Code Example asasa Code Example
sanity react Code Example sanity react Code Example
Laravel bootstrap 5 install popper.js error Code Example Laravel bootstrap 5 install popper.js error Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8