Friday, 2 January 2015

console.log function

The console.log function is not actually a part of the JavaScript language itself.

Standard built-in objects

JavaScript has several objects included in its core, for example, there are objects like Math, Object, Array, and String.

The example below shows how to use the Math object to get a random number by using its random() method.
console.log(Math.random());
 

Standard objects (by category)

Value properties

Global properties returning a simple value.

Function properties

Global functions returning the result of a specific routine.

Fundamental objects

General language objects, functions and errors.

Numbers and dates

Objects dealing with numbers, dates and mathematical calculations.

Text processing

Objects for manipulating texts.

Indexed collections

Collections ordered by an index. Array-type objects.

Keyed collections

Collections of objects as keys. Elements iterable in insertion order.

Structured data

Data buffers and JavaScript Object Notation.

Control abstraction objects

Reflection

Internationalization

Additions to the ECMAScript core for language-sensitive functionalities.

Non-standard objects

Other

Global Object

Global objects refer to objects in the global scope (but only if ECMAScript 5 strict mode is not used! Otherwise it returns undefined). The global object itself can be accessed by the this operator in the global scope. In fact, the global scope consists of the properties of the global object (including inherited properties, if any).

Other objects in the global scope are either created by the user script or provided by the host application. The host objects available in browser contexts are documented in the API reference.