Global Objects

In browser, window is the global object. All variables and functions defined inside script become members of the window object in browser. In Nodejs environment, variables in the script are scoped to module only.

Built in Objects

There are several built in objects as mentioned below.

  1. Date - used to work with dates
  2. RegEx - used to work with regular expressions
  3. Math - This object provides mathematical functions
  4. JSON - This object provides functions to work with JSON data

JSON object

This object provides 2 methods - parse and stringify. JSON is a object. It is not a function. So we can not call it directly. But we can definitely access it's properties and methods.

Date object

Date is a function and as you know, functions are first class objects in JavaScript. This means that we can call Date function. e.g. Date() - returns the current date and time.
Youtube | Facebook | Twitter | Website Home | Online Grocery Shopping Brisbane