The Difference Between Methods And Functions
Often used interchangeably to describe the same thing, a method is a function used within the context of a class or object.
In JavaScript, Math.random()
is a method, as it is a function of the Math class.