Vue

GetPlugin ('lodash').isequal (this.$data, This.$options.data.apply(this)) // Restore the value of this binding to the initial state object.assign (this, This. $options. The data ()) / / string in the array Number [' 1 ', '2', '3'). The map (Number)Copy the code

React

Yarn add eslint yarn add babel-eslint // eES2015 and above yarn add eslint-config-airbnb // Configure some ESLint rules Yarn add eslint-plugin-import // when import is used, Yarn add eslint-plugin-react // Some react ESlint rules specification yarn add eslint-plugin-jsx-a11y // some JSX rules Rules specification // Create the base.eslintrc.js yarn ESlint --initCopy the code

JS

// ES6 loop array. apply(null, {length: ForEach (() => {// do someting}).map(Number) // Check device type (PC or mobile) (function() {var  url = location.href; // replace www.test.com with your domain if ((url.indexOf('www.test.com') ! = -1) && navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)) { var newUrl = url.replace('http://www', 'http://m'); location.href = newUrl; }}) ();Copy the code

node

// Updates dependencies to the latest version according to the version range specified in package.json file // --latest: ignores the version range specified in package.json yarn upgrade yarn upgrade-interactiveCopy the code

The HTTP status code

100 Continue When a POST request is sent, the server will return this message confirming that the HTTP header has been sent. 201 Created the request is successful and a new resource is Created on the server. 202 Accepted the request was Accepted but not yet processed. 301 Moved Permanently The page for the request Permanently Moved to a new location. 302 Found Temporary redirect. 303 See Other Temporary redirects and always uses GET to request new URIs. The requested page has Not been Modified since the last request. 400 The Bad Request server cannot understand the format of the Request. The client should not attempt to use the same content to initiate a Request again. 401 Unauthorized The request is not authorized. 403 Forbidden Forbidden access. 404 Not Found The resource how to match the URI was Not Found. 500 Internal Server Error Common Server errors. 503 Service Unavailable The server cannot process the request temporarily (possibly due to overload or maintenance).Copy the code

Http

  • Running on top of TCP
  • Essentially, it is a protocol for communication between Web front-end programs and Web back-end programs
  • Specifies the format in which the client communicates with the server

RESTful

  • REST is a style, not a standard
  • REST makes full use of and relies on the HTTP protocol
  • Explicitly use different HTTP request methods
  • The action type can be Add, change, or delete the invoked resource