Questions front end face (IV)

1. existing code as follows:

let name = 'aaa';

let obj = {

  name : 'bbb',

  dose : function(){

  this.name = 'ccc';

  }

};

let does = obj.dose;

does();

console.log(obj.name);

Problem: Write A print-out value.

// 'bbb'

2. Write a function that parses Query String and go back parsed object.

The input: a = b & c = d;

The output object:

{

  a : 'b',

  c : 'd'

}

3. Give the following list li node to bind the click event, its order in the list of pop (page does not jump) click:

<ul id="nav">

  <li><a href="http://qq.com">QQ</a></li>

  <li><a href="http://baidu.com">Baidu</a></li>

  <li><a href="http://jd.com">JD</a></li>

  <li><a href="http://taobao.com">Taobao</a></li>

</ul>

Click on the column where as QQ, pop-up 1; click on the column where the pop Baidu 2 ... ... and so on.

4. achieve a throttling function (Throttle) function.

The variable is determined to achieve a function Array, Object, String or Number.

6. for(var a=0; a<10; a++){

  setTimeout(function(){

    console.log(a);

  },1000)

}

What are the outcomes? why?

7. css achieve fixed left and right adaptive layout.

8. div several ways to write a horizontal centered vertically.

9. Use a regular expression to achieve a hyphen naming hump named.

10. Achieving the Parent a parent, it may receive a name name, as well as a method eat, then implement a subclass inherits the parent class, and subclass of the parent class covering eat.

Guess you like

Origin www.cnblogs.com/JoeyOnly/p/11700163.html