You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getters are declared without a parameter list. The body of the getter is executed when a property with that name is accessed.
class Circle {
init(radius) {
this.radius = radius;
}
area {
return 3.141592653 * this.radius * this.radius;
}
}
var circle = Circle(4);
print circle.area; // Prints roughly "50.2655".
The text was updated successfully, but these errors were encountered:
Getters are declared without a parameter list. The body of the getter is executed when a property with that name is accessed.
The text was updated successfully, but these errors were encountered: