Skip to content

Instantly share code, notes, and snippets.

View danny-andrews's full-sized avatar

Danny Andrews danny-andrews

View GitHub Profile
@danny-andrews
danny-andrews / get-class.js
Created July 11, 2017 19:12
Get Class Javascript
/**
* Returns internal [[Class]] property of an object
*
* Ecma-262, 15.2.4.2
* Object.prototype.toString( )
*
* When the toString method is called, the following steps are taken:
* 1. Get the [[Class]] property of this object.
* 2. Compute a string value by concatenating the three strings "[object ", Result (1), and "]".
* 3. Return Result (2).