Built in objects in javascript

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.
  • Date - used to work with dates
  • RegEx - used to work with regular expressions
  • Math - This object provides mathematical functions
  • 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.
Complex problems, Simple Solutions