Skip to content

Instantly share code, notes, and snippets.

@rahulmalhotra
Created February 17, 2021 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulmalhotra/81528c7f8e4e7161ea7a5f9fbd242621 to your computer and use it in GitHub Desktop.
Save rahulmalhotra/81528c7f8e4e7161ea7a5f9fbd242621 to your computer and use it in GitHub Desktop.
This code snippet is used in ES6 Classes JavaScript Tutorial on SFDC Stop
class Car {
constructor(name, speed) {
this.name = name;
this.speed = speed;
}
showSpeed() {
console.log(this.speed);
}
}
let audi = new Car('audi', 300);
audi.showSpeed();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment