Показать сообщение отдельно
  #9 (permalink)  
Старый 22.02.2012, 19:21
Аватар для DreamTheater
Профессор
Отправить личное сообщение для DreamTheater Посмотреть профиль Найти все сообщения от DreamTheater
 
Регистрация: 15.02.2011
Сообщений: 471

https://developer.mozilla.org/en/Jav...bject/toString

Цитата:
Using toString() to detect object class

toString() can be used with every object and allows you to get its class. To use the Object.prototype.toString() with every object, you need to call Function.prototype.call() or Function.prototype.apply() on it, passing the object you want to inspect as the first parameter called thisArg.
var toString = Object.prototype.toString;

toString.call(new Date); // [object Date]
toString.call(new String); // [object String]
toString.call(Math); // [object Math]

//Since JavaScript 1.8.5
toString.call(undefined); // [object Undefined]
toString.call(null); // [object Null]
Ответить с цитированием