A method is a function associated with an object and invoked through that object. In JavaScript, the way a function is invoked determines its `this` value: `ninja.skulk()` invokes `skulk` as a method, tying the call to `ninja`. This differs from languages where `this` is determined only by where a method is defined. section 6.2 section 6.1
function skulk(name) {}
function Ninja(name) {}
skulk("Hattori"); #A
(function (who) { #A
return who; #A
})("Hattori"); #A
const ninja = {
skulk: function () {},
};
ninja.skulk("Hattori"); #B
ninja = new Ninja("Hattori"); #C
skulk.call(ninja, "Hattori"); #D
skulk.apply(ninja, ["Hattori"]); #E
Compare method invocation with standalone calls, constructor calls, and calls using `call` or `apply`. section 6.2
A method can be assigned to a variable, but calling it separately may lose its object context. The same trap occurs when passing a method as a callback: the receiving function gets the function, not its original object association. Function binding and arrow functions are tools for addressing this unbound-method problem. section 6.1 section 6.3
























