Front-end Knowledge Point finishing 03

Source: Internet
Author: User

75. Tell me about your understanding of the front-end architects

Responsible for the management of front-end team and coordination with other teams, improve team members ' ability and overall efficiency; lead the team to design, develop and maintain the front-end parts of the development tools and the platform, lead the team in front-end field research and new technology investigation, ensure the team's technical leadership is responsible for the front-end development of the specification, Functional modular design, public component building and other work, and organize training.

implement a function clone to replicate values for 5 major data types in JavaScript, including number, String, Object, Array, Boolean

function () {            varthis. constructor = = = Array?  [] : {};              for (varin this) {                     typeof the This this[E];            }             return o;    }


76. Talk about the limitations of strict mode

Strict mode mainly has the following limitations:

Variables must be declared before they are used

The function parameter cannot have the same name attribute, otherwise the error

Cannot use with statement

Cannot assign a value to a read-only property, otherwise an error

Cannot use prefix 0 for octal number, otherwise error

Cannot delete non-deleted properties, otherwise error

Cannot delete variable delete prop, error, only delete attribute delete Global[prop]
Eval does not introduce variables in its outer scope

Eval and arguments cannot be re-assigned

Arguments does not automatically reflect changes in function parameters

Cannot use Arguments.callee

Cannot use Arguments.caller

Prohibit this from pointing to global objects

You cannot use Fn.caller and fn.arguments to get the stack of a function call

Added reserved words (such as protected, static, and interface)

The purpose of setting up a "strict mode" is mainly as follows:

Eliminate some unreasonable and unreasonable JavaScript grammar, reduce some strange behavior;

To eliminate some of the unsafe code operation, to ensure the security of code operation;

Improve compiler efficiency, increase running speed;

Pave the future for new versions of JavaScript.

Note: Strict mode is not supported for tested ie6,7,8,9.

77. How to delete a cookie

1. Set the time to the current time to move forward.

var date = new Date ();

Date.setdate (Date.getdate ()-1);//Real deletion

The SetDate () method is used to set up a day for one months.

Settings for 2.expires

Document.cookie = ' user= ' + encodeuricomponent (' name ') + '; expires = ' + new Date (0)

<strong>,<em> and <b>,<i> tags

<strong> tags, like <em> tags, are used to emphasize text, but it emphasizes a bit more.

EM is the Italic accent label, more strongly emphasized, which represents the emphasis point of the content. Equivalent to <i>...</i>; in HTML elements

< b > < i > are visual elements that represent meaningless bold, meaningless italic.

Em and strong are expression elements (phrase elements).

78. Tell me about your understanding of AMD and Commonjs

COMMONJS is a specification for server-side modules, and node. JS uses this specification. The COMMONJS specification loading module is synchronous, that is, only the loading is complete before the subsequent operation can be performed. The AMD specification is a non-synchronous loading module that allows you to specify a callback function.

AMD recommended style by returning an object as a Module object, the COMMONJS style is designed to expose the object of the module by assigning values to module.exports or exports properties.

Details: Also talk about Webpack and its development mode

usage of 79.document.write ()

The document.write () method can be used in two ways: to create page content in a live script during page loading, and to create the contents of this window or a new window with a deferred script.

Document.Write can only redraw the entire page. innerHTML can redraw part of a page

80. Write a method to find the byte length of a string

Suppose: An English character occupies one byte and a Chinese character occupies two bytes

function GetBytes (str) {        var len = str.length;         var bytes = len;          for (var i=0; i<len; i++) {            if (str.charcodeat (i) > 255) bytes++;        }         return bytes;    } Alert (GetBytes ("Hello, as"));

the difference between 81.git fetch and git pull

Git pull: the equivalent of getting the latest version from remote and merge to local

git fetch: The equivalent of getting the latest version from remote to local, not automatically merge

82. Tell me about your understanding of MVC and MVVM

Mvc
View Transfer command to Controller

Controller needs Model to change state after completion of business logic

Model sends new data to View, user gets feedback

All communications are one-way.

Angular it uses two-way binding (data-binding): The change of view is automatically reflected in ViewModel, and vice versa.

Component model, View, ViewModel

View:ui interface

ViewModel: It is the abstraction of view, which is responsible for the information transformation between view and model, and transmits the command of view to model;

Model: Data Access Layer

83. Please explain what an event agent is

Event delegation, also known as event delegation. is a common technique for binding events commonly used in JavaScript. As the name implies, "event broker" is to delegate an event that would otherwise be bound to the parent element, so that the parent element acts as an event listener. The principle of the event proxy is that the event bubbling of DOM elements. The advantage of using event proxies is that you can improve performance.

What is the difference between a 84.attribute and a property?

attribute is the attribute that DOM elements have in the document as HTML tags;

The property is the attribute that the DOM element owns as an object in JS.

So:

For the standard attributes of HTML, the attribute and property are synchronized and are automatically updated.

However, for custom properties, they are not synchronized,

84. What are the seven layers of the seven-tier model in the network hierarchy ?

Application tier: Application layer, presentation layer, Session layer (top down) (HTTP, FTP, SMTP, DNS)

Transport layer (TCP and UDP)

Network Layer (IP)

Physical and Data Link Layer (Ethernet)

The function of each layer is as follows:

Physical layer: Transmission of bits via media, determination of mechanical and electrical specifications (bit bit)

Data Link layer: Assemble bits into frames and point-to-place passes (frames frame)

Network layer: Responsible for packet transfer from source to host and Internetwork (package packet)

Transport Layer: Provides end-to-end reliable message delivery and error recovery (segment segment)

Session Layer: Establish, manage, and terminate sessions (Session Protocol data Unit SPDU)

Presentation layer: Translating, encrypting, and compressing data (representing protocol data unit PPDU)

Application layer: means to allow access to the OSI environment (Application Protocol Data unit APDU)

Various protocols

ICMP protocol: Internet Control Message Protocol. It is a sub-protocol of the TCP/IP protocol family that is used to pass control messages between IP hosts and routers.

TFTP protocol: A protocol used by the TCP/IP protocol family to provide simple file transfer between the client and server, providing an uncomplicated, inexpensive file transfer service.

HTTP protocol: Hypertext Transfer Protocol, an object-oriented protocol belonging to the application layer, is suitable for distributed hypermedia information System because of its simple and fast way.

DHCP protocol: Dynamic Host Configuration Protocol, is a means of allowing the system to connect to the network, and obtain the required configuration parameters.

85. Talk about the difference between MongoDB and MySQL

MySQL is a traditional relational database, MongoDB is a non-relational database

MongoDB is stored in the Bson structure (binary), which has obvious advantages for mass data storage.

Compared to the traditional relational database, NoSQL has a very significant performance and scalability advantages, and relational database, the advantages of MongoDB are: ① weak consistency (eventually consistent), more to ensure the user's access speed: ② document structure of the storage mode, can be more convenient to obtain data.

86. Talk about the principle of 304 cache

The server first generates the ETag, which the server can later use to determine if the page has been modified. Essentially, the client requires the server to validate its (client) cache by passing the token back to the server.

304 is the HTTP status code, the server used to identify the file is not modified, do not return content, the browser after receiving a status code, the browser will use the cached files

The client requests a page (a). The server returns page A and adds an etag to a. The client presents the page and caches the page along with the ETag. The customer requests page A again and passes the etag that the server returned on the last request to the server. The server examines the ETag and determines that the page has not been modified since the last client request, directly returning a response of 304 (unmodified--not Modified) and an empty response body.

87. What kind of front-end code is good

Gao with low coupling, so that the file is small, well maintained, and well extended.

Original address: http://www.qdfuns.com/notes/38721/bed740616de4e5795baa5a28cc7be08c.html

Front-end Knowledge Point finishing 03

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.