Javascript - Methods (Functions Inside Objects)
Code Life
By Pierre Marsaa
A Function as a Property
A property value can be anything... including a function. A function stored in an object is called a method. You call it with a dot, like reading a property, plus parentheses:
↗️
Loading editor...
↶
↷
You've been using methods since the beginning: team.push(), moves.includes()... Now you know what they are: functions that belong to an object.
Verify