DEV Community

James L
James L

Posted on

🎄JS Advent #6 - Host vs Native objects🎄

For the month of December I have challenged myself to write 24 articles about some JS concepts up until Xmas.
The sixth installment in this series is about Host and Native objects.

What is a native object?

  • A native object is provided by Javascript itself. Their behaviour does not change based on the environment they are used in.
  • Some examples of native objects are String() Array Number(), true.

What is a host object?

  • A host object is an object provided by the environment Javascript is being executed in.
  • This will vary based on where the code is run.
  • Web browsers will allow you to access a window and console object, but these will not be available on a NodeJs server.

Top comments (0)