0

I cannot find the source code of the method of JavaScript defaut object like string, Math, and array.

for example when I call the method trim() without parentheses to get the source it only says:-

function trim() { [native code] }

Where is this Native code???

  • 1
    _“when I call the method trim() without parentheses”_ — That’s not a _call_; you’re just referencing the function. This will not produce the _“[native code]”_ output unless you stringify the function in some way. If you want the algorithm that [`trim`](//developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) follows, take a look at the [specification](//tc39.es/ecma262/#sec-string.prototype.trim). – Sebastian Simon Dec 14 '22 at 02:10

0 Answers0