What are the common operations of ECMAScript
{$.ajax ({method:'GET', url, success:data = > resolve (data), error:data = > reject ()})} async function sendXML () {let result = await getNews ('http://localhost:3000/news?id=7');) Result = await getNews ('http:localhost:3000' + result.commentUrl);} sendXML (); detailed use of class class 1. Define class / implement class inheritance through class 2. The constructor 3. 0 is defined by constructor in the class. Create an instance of the class through new. 4. Through extends to achieve class inheritance 5. 5. Call the constructor of the parent class 6. 0 through super. Override the general method inherited from the parent class / / normally create the object function Person (name,age) {this.name=name; this.age=age;} let p = new Person ('kond',22); / / define the class class Person {constructor (name,age) {/ / define the constructor this.name=name; this.age=age using class } getName () {/ / define general methods console.log (this.name);}} let p = new Person ('king',33); p.getName (); / / use class implementation to inherit class StartPerson extends Person {constructor (name,age,salary) {super (); this.salary = salary }} string, array extension 1.includes (str): determine whether to contain the specified string 2.startsWith (str): determine whether to start with the specified string 3.endsWith (str): determine whether to end with the specified string 4.repeat (count): repeat the specified number of times the extension 1. Binary and octal numerical representation: 0b for binary and 0o console.log (0b1010) for octal / / for decimal 10 2.Number.isFinite (I): determine whether it is a finite number 3.Number.isNaN (I): determine whether it is NAN 4.Number.isInteger (I): determine whether it is an integer 5.Number.parseInt (str): convert a string to the corresponding number Number.parseInt ('123abc') / / 123 6.Math.trunc (I): directly remove decimal array extensions: 1.Array.from (v): convert pseudo-array objects or traversable objects to true array 2.Array.of (v1) V2recoveryv3): converts a series of values into an array let arr = Array.of (1 mine2 minefield abcprecinct true) 3.find (function (value,index,arr) {return true}): find the first element that satisfies the condition true let arr2 = [2, item,index, 3, 5, 5, 6, 7, 8]; let result = arr2.find (function (item,index) {return item > 4) }) 4.findIndex (function (value,index) Arr) {return true}): find the subscript object method extension of the first element that satisfies the condition to return true: 1.1.Object.is (v1) V2): judge whether the two data are completely equal. 0 = =-0 / / true NaN = = NaN / / false Object.is (0maireli 0) / / false the underlying comparison is the string value Object.is (NaN,NaN) / / true 2.Object.assign (target,source1). Source2): copy the properties of the source object to the target object let obj = {} let obj2 = {username:'zhang',age:22} Object.assign (obj,obj2) 3. Directly manipulate the _ _ proto__ attribute let obj2 = {} obj2.__proto__ = obj1; deeply clone the basic data type copy: new data will be generated after the copy, and the modified copied data will not affect the original data object / array copy: the copy will not generate new data, but will copy the reference. Modifying the copied data will affect the method of copying the data: 1. Directly assign a value to a variable / / shallow copy 2.Object.assign () / / shallow copy 3.Array.prototype.concat () / / shallow copy 4.Array.prototype.slice () / / shallow copy 5.JSON .parse (JSON.stringify) / / Deep copy! Shallow copy: a reference to a copy. Modifying the data after the copy will affect the deep copy of the original data: generate new data when you copy The modified copied data will not affect the original data set, Map container 1.Set container: disordered and unrepeatable collection of multiple value set () set (array) add (value) delete (value) has (value) clear () size () 2.Map container: disordered key non-repeatable collection of multiple key-value Map () Map (array) set (key Value) / / add get (key) delete (key) has (key) / / to determine whether there is clear () size let set = new Set ([1, 2, 3, 3, 4, 5, 6]) Set.add (7); let map = new Map ([['aaa','username'], [36 aaa','username']]) map.set (78); map.delete (78); for of cycle: 1. Traversal array 2. Traverse set 3. Traverse map 4. Traversal string 5. Traversing the pseudo array so far, I believe you have a deeper understanding of "what are the common operations of ECMAScript?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!