inspect

Object.inspect(obj) -> String

返回 obj 针对调试的字符串表现形式。

Prototype 为许多类型提供了 inspect 方法——不论是内建的类型还是库自定义的类型。例如 StringArrayEnumerableHash,这些方法试图从开发人员的角度出发, 为它们所属的类型提供更为有意义的字符串描述形式。

样例

Object.inspect() 
// -> 'undefined' 
Object.inspect(null)
// -> 'null' 
Object.inspect(false) 
// -> 'false' 
Object.inspect([1, 2, 3]) 
// -> '[1, 2, 3]' 
Object.inspect('hello') 
// -> "'hello'"