Share several typical javascript interview questions and several javascript questions

Source: Internet
Author: User

Share several typical javascript interview questions and several javascript questions

These questions are a bit interesting. You can study them to help you improve your skills.

1. What is output during the call process?

Function fun (n, o) {console. log (o); return {fun: function (m) {return fun (m, n) ;}} var a = fun (0);. fun (1);. fun (2);. fun (3); var B = fun (0 ). fun (1 ). fun (2 ). fun (3); var c = fun (0 ). fun (1); c. fun (2); c. fun (3 );

2. What is the value in console. log?

Var s = 3; function test () {var s = 2; function f () {return s;} return f;} var test = test (); console. log (test); var f = test (); console. log (f );

3. What is the value in console. log?

Var arr = []; function fun () {for (var I = 0; I <4; I ++) {var x = {}; x. no = I; x. test = arr [I]; x. fun = function () {console. log (I);} arr. push (x) ;}} fun (); console. log (arr [0]. fun (); console. log (arr [1]. fun (); console. log (arr [2]. fun (); console. log (arr [3]. fun ());

 

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.