谈谈Javascript设计

3,035 views

Published on

很幽默有木有?

Published in: Technology
  • good!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

谈谈Javascript设计

  1. 1. JavaScript
  2. 2. XD
  3. 3. ; , . [] {}
  4. 4. - -_-b-var _ = -1, b = -1;return -_-b;
  5. 5. -var a, b, c;a = b = 1;var node;if(node = D.get(‘myId’)) { // ...
  6. 6. -if(a != b) -> if(a - b)if(a == b) -> if(!(a - b))== & ===,
  7. 7. -, . [] {};,{}
  8. 8. -, . [] {}.[]
  9. 9. -newindeletetypeofinstanceof typeof & instanceof?
  10. 10. -var
  11. 11. -if...else ifif continue/break?switch...case
  12. 12. - gotofor while/do...while?do...while(0)?
  13. 13. - debuggerreturnthrowtry...catch(e)
  14. 14. -Functionjscex:
  15. 15. NaN: parseundefined: null NaN & undefined?
  16. 16. (Scalar)(Object)
  17. 17. -
  18. 18. -
  19. 19. call & applyarguments
  20. 20. -call & applyvar log = function() { window.console && console.log.apply(console, arguments);};var w = document.write;w.call(document, ‘some message’);
  21. 21. -argumentsIt’s automaticvar init = function() { return function() { if(arguments.callee.invoked) return; arguments.callee.invoked = true; // ...
  22. 22. janlay@gmail.com @janlay

×