Skip to content

Commit b10deb7

Browse files
committed
[fix BonsaiDen#285] be more specific about return value
1 parent e8c1b03 commit b10deb7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

doc/en/types/typeof.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ The *Class* refers to the value of the internal `[[Class]]` property of an objec
4242
> following strings. `Arguments`, `Array`, `Boolean`, `Date`, `Error`,
4343
> `Function`, `JSON`, `Math`, `Number`, `Object`, `RegExp`, `String`.
4444
45-
In order to retrieve the value of `[[Class]]`, one has to make use of the
46-
`toString` method of `Object.prototype`.
47-
4845
### The Class of an Object
4946

50-
The specification gives exactly one way of accessing the `[[Class]]` value,
51-
with the use of `Object.prototype.toString`.
47+
The only way to determine an object's `[[Class]]` value is using `Object.prototype.toString`. It
48+
returns a string in the following format: `'[object ' + valueOfClass + ']'`, e.g `[object String]` or
49+
`[object Array]`:
5250

5351
function is(type, obj) {
5452
var clas = Object.prototype.toString.call(obj).slice(8, -1);

0 commit comments

Comments
 (0)