“Ups di JS” Kode Jawaban

Ups di 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

Ups di JavaScript

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

Jawaban yang mirip dengan “Ups di JS”

Pertanyaan yang mirip dengan “Ups di JS”

Lebih banyak jawaban terkait untuk “Ups di JS” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya