1

Am I right in thinking that we can’t actually see the body of built-in constructor functions - i.e. String - because it's written in different language(s)?

In the console it comes up as 'native code'.

  • It's unclear what you mean by "see". `"String" in window` is perfectly visible even if it was defined by the engine, no? – Bergi Jul 26 '20 at 20:43
  • Do you mean the source code of these built in functions? – Unmitigated Jul 26 '20 at 20:44
  • Seems this question is just about which language JavaScript implementations are written in, not specifically constructors? Dupe of [Which language is JavaScript written in](https://stackoverflow.com/questions/7005729/what-language-is-javascript-written-in)? – trincot Jul 26 '20 at 20:45
  • Another reason for not showing the code (if it's JS) is to prevent browser fingerprinting. – Jonas Wilms Jul 26 '20 at 21:19

1 Answers1

1

Functions which appear as [native code] appear that way because they are exactly that: native code. Their content is written in the language the javascript runtime is written in (e.g. node is written in C++ and deno is written in Rust).

Aplet123
  • 33,825
  • 1
  • 29
  • 55