前端调试技巧

1.console.log

 

console.log(test());     // 1

delete test;

console.log(typeof test);     // undefined

 

2.eval

  var GLOBAL_OBJECT = this;



  /* `foo` is created as a property of calling context Variable object,

      which in this case is a Global object */



  eval('var foo = 1;');

  GLOBAL_OBJECT.foo; // 1

 

3.delete 操作符

var o = { x: 1 };

delete o.x; // true

o.x; // undefined

http://www.cnblogs.com/jscode/archive/2012/09/02/2667464.html

 

你可能感兴趣的:(前端)