前端调试技巧

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

 

posted on 2015-06-15 15:09  viewcozy  阅读(176)  评论(0编辑  收藏  举报