Web front End--face question

Source: Internet
Author: User
Tags border color

1.border which color is used by default when no color is specified?

Answer: Border color is inherited if color is not specified otherwise RGB (0,0,0)

What's the device-width of 2.iphone6?

Answer: 375px

What is the difference between this in the arrow function in 3.ES6 and this in the normal function?

Answer:

This in the normal function

1.this always stands for its immediate callers

The object in the object is pointed to by this

This in the function points to the window

The This in the event points to the DOM

2. The direct caller is not found by default (non-strict mode, use strict not used), this points to window

3. This in a function that does not have a direct caller in strict mode points to the window

4. Using the call apply bind binding, this points to the bound object.

* * Global variables are mounted under the Window object

* * In the normal function this points to its immediate caller, if the caller is not found the window

* * Our common window properties and methods are: alert, location,document,parseint,settimeout,setinterval, etc., window's properties by default can omit the window prefix!

11.function Test () {

Console.log (This)

}

Test ()

The result is window

Reason: Test () is a global function, which means that it is hung under the Window object, so test () is equivalent to Window.test () so this time this point is pointing to the window

22.

    1.  var obj = {
    2.    say: function () {
    3.      setTimeout(function () {
    4.        console.log(this)
    5.      });
    6.    }
    7.  }
    8.  obj.say();

The result is window

anonymous function, the function in the timer, because there is no default host object, so the default this point to the window

This in the arrow function

The default is to point to the object that it is in when it is defined, not the object at the time it is executed, possibly the window

Web front End--face question

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.