Answers for "design pattern in js"

-1

design pattern in js

var TeslaModelS = function() {
    this.numWheels    = 4;
    this.manufacturer = 'Tesla';
    this.make         = 'Model S';
}

TeslaModelS.prototype = {
    go: function() {
    // Rotate wheels
    },
    stop: function() {
    // Apply brake pads
    }
}
Posted by: Guest on June-04-2021

Browse Popular Code Answers by Language