Created
February 17, 2021 03:39
-
-
Save rahulmalhotra/ff3e5e0d5c7d389aaeecacea543c4c5a to your computer and use it in GitHub Desktop.
This code snippet is used in ES6 Classes JavaScript Tutorial on SFDC Stop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Car(name, speed) { | |
this.name = name; | |
this.speed = speed; | |
} | |
Car.prototype.showSpeed = function() { | |
console.log(this.speed); | |
} | |
let audi = new Car('audi', 200); | |
audi.showSpeed(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment