“Hoppla in js” Code-Antworten

Hoppla in js

// Defining class in a Traditional Way.
function Vehicle(name,maker,engine){
    this.name = name,
    this.maker = maker,
    this.engine = engine
};
 
Vehicle.prototype.getDetails = function(){
    console.log('The name of the bike is '+ this.name);
}
 
let bike1 = new Vehicle('Hayabusa','Suzuki','1340cc');
let bike2 = new Vehicle('Ninja','Kawasaki','998cc');
 
console.log(bike1.name);
console.log(bike2.maker);
console.log(bike1.getDetails());
5035 Kamesh Raghul

Hoppla in JavaScript

const book = {   title: "Hippie",       author: "Paulo Coelho",     year: "2018"}
Amused Anaconda

Ähnliche Antworten wie “Hoppla in js”

Fragen ähnlich wie “Hoppla in js”

Weitere verwandte Antworten zu “Hoppla in js” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen