There was an error while loading. Please reload this page.
this is used as the name of the first argument of a function to turn it into a method.
this
func getFullname(this *Person) String { return this.firstname + " " + this.lastname }
Methods declared within a struct's domain don't take an initial parameter, so this is not used.
struct Person (firstname, lastname String) { func swapFirstnameLastname() void { tmp String = this.firstname this.fistname = this.lastname this.lastname = tmp } }
Table of Contents