Answers for "how to make pattern in js"

0

how to make pattern in js

for (var i = 5; i >= 1; i--) {
    var str = "";
    for (var j = i; j >= 1; j--) str += j;
    console.log(str);
}
Posted by: Guest on June-20-2021
-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

Code answers related to "Javascript"

Browse Popular Code Answers by Language