[Go] Test your javascript.

Source: Internet
Author: User

http://sentsin.com/

Although today's JavaScript has been leaps and bounds, but JS's many features are still retained, the following topics are not intentionally set pits, many places will verify your JS, if the wrong half, please do not tell me that you are engaged in the front.

  1. 1.
    (function () {  return typeof arguments;}) ();
    • "Object"
    • "Array"
    • "Arguments"
    • "undefined"
  2. 2.
     var f = function g () {return 23;};
     typeof g (); 
    • "number" /label>
    • "undefined"
    • "function"
    • error
  3. 3.
     (function (x) {delete x; return x;})
     (1); 
    • 1
    • null
    • undefined
    • error
  4. 4.
     var y = 1, x = y = typeof x;x; 
    • 1
    • "number"
    • Input id= "answer-4-3" type= "Radio" name= "question-4" > undefined
    • " undefined "
  5. 5.
     (function f (f) {return typeof F ();})
     (function () {return 1;}); 
    • "number" /label>
    • "undefined"
    • "function"
    • error
  6. 6.
     var foo = {bar:function () {return this.baz; }, Baz:1};(function () {return typeof arguments[0] ();})
     (foo.bar); 
    • "undefined "
    • " object "
    • "number"
    • "function"
  7. 7.
     var foo = {bar:function () {return this.baz;
     }, baz:1}typeof (f = foo.bar) (); 
    • "undefined "
    • " object "
    • "number"
    • "function"
  8. 8.
     var F = (function f () {return "1";   }, function g () {return 2;
     }); typeof F; 
    • "string" /label>
    • "number"
    • "function"
    • "undefined"
  9. 9.
     var x = 1;if (function f () {}) {x + = typeof F;}
     x; 
    • 1
    • "1function"
    • Input id= "answer-9-3" type= "Radio" name= "question-9" > "1undefined"
    • nan
  10. Ten.
     var x = [typeof x, typeof y][1];typeof typeof X; 
    • "number"
    • "string"
    • "undefined"
    • "object"
  11. one.
     (function (foo) {return typeof Foo.bar;})
     ({foo: {bar:1}}); 
    • "undefined "
    • " object "
    • "number"
    • error
  12. 12.
    (function f () {  function f () {return 1;}  return f ();  function f () {return 2;}}) ();
    • 1
    • 2
    • Error (e.g. "Too much recursion")
    • undefined
  13. 13.
    function f () {return F;} New F () instanceof F;
    • true
    • false
  14. 14.
    With (function (x, undefined) {}) length;
    • 1
    • 2
    • undefined
    • Error
Study questions: How do I change the typeof type of undefined? (that is, typeof undefined or typeof (undefined) are not "undefined")

[Go] Test your javascript.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.