0

I just installed sleep Node.js module and have implemented in my code. When I try the following code console.log(sleep.usleep.toString()); the result shows [native code] instead of the actual code inside usleep(), but when I try the same thing on my functions, it includes all the code in the return value of .toString():

function a() {
    //code
}
console.log(a.toString());

How come .toString() doesn't reveal the code inside sleep.usleep()?

Ramtin Soltani
  • 2,650
  • 3
  • 24
  • 45
  • Not 100% sure, but I usually get [native code] when I toString() methods defined on a prototype. – Shilly Jul 01 '16 at 14:07

1 Answers1

1

[Native code] means that it's a function implemented in the javascript engine of your browser in native code and not in javascript.

ADreNaLiNe-DJ
  • 4,787
  • 3
  • 26
  • 35