Coggle requires JavaScript to display documents.
this
new
function Greeting() { console.log(this) } Greeting() new Greeting()
> Window {window: Window...} > Greeting {}
Greeting
function User(fName, lName) { this.firstName = fName this.lastName = lName this.fullName = function() { return this.firstName + ' ' + this.lastName } } let user1 = new User('Renay', 'Earnshaw') let user2 = new User('Philip', 'Earnshaw')
User
firstName
lastName
fullName
User('Renay', 'Earnshaw') console.log(firstName) console.log(fullName())
> Renay > Renay Earnshaw