Why does JavaScript's `function.call` have to be called explicitly?
Clash Royale CLAN TAG #URR8PPP Why does JavaScript's `function.call` have to be called explicitly? I have a string, " test " . It's a really ugly string, so let's trim it. " test " " test ".trim() returns "test" . Nice! " test ".trim() "test" Now let's try to do it with that string as an argument. String.prototype.trim.call(" test ") also returns "test" . Nice again! String.prototype.trim.call(" test ") "test" Oh, that means I can use String.prototype.trim.call to map an array of ugly strings by their trimmed counterparts, right? String.prototype.trim.call [" test "].map(String.prototype.trim.call) does not return ["test"] . [" test "].map(String.prototype.trim.call) ["test"] It throws TypeError: undefined is not a function . TypeError: undefined is not a function Why is this not allowed? .map...