Last active
July 24, 2019 15:01
-
-
Save abhikulshrestha22/acfeb7ca4361ce93c44039ba85b946fd to your computer and use it in GitHub Desktop.
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
var fruit1 = { | |
name: 'Apple', | |
quantity: 2, | |
getString: function(){ | |
// this refers to the object fruit1. | |
return `${this.quantity} ${this.name} remaining` | |
} | |
} | |
console.log(fruit1.getString()) | |
// "2 Apple remaining" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment