Properties

Get a brief introduction to properties.

Introduction

Properties allow using member functions like member variables.

You are familiar with this feature from slices. The length property of a slice returns the number of elements of that slice:

Get hands-on with 1200+ tech skills courses.