toSource()

优质
小牛编辑
118浏览
2023-12-01

toSource 方法

返回表示对象源代码的字符串。

语法:

  booleanObject.toSource();

注:

该方法在 Internet Explorer 中无效。

示例:

  var Bool = new Boolean( false ),
      s = Bool.toSource();

  console.log( s );
  console.log( typeof s );

结果:

  >>>
  (new Boolean(false))
  string