Skip to content

Instantly share code, notes, and snippets.

@moiz-frost
Last active September 3, 2019 18:04
Show Gist options
  • Save moiz-frost/1aa976f16c2c81bd5853462af10ab83e to your computer and use it in GitHub Desktop.
Save moiz-frost/1aa976f16c2c81bd5853462af10ab83e to your computer and use it in GitHub Desktop.
JavaScript This
var horsePower = 50;
function printHP() {
console.log(this.horsePower);
}
var car = {
year: '2010',
make: 'Honda',
color: 'White',
transmission: 'Manual',
horsePower: 140,
topSpeed: 120,
printHP: printHP
}
printHP(); // 50
car.printHP(); // 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment