In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points of the ES6 interview questions, the content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
1.let variable declarations and properties
Declare variable
Let a; let b, c, d; let e = 1; let f = 2, g = 3
Characteristics
Cannot repeat the statement
Block-level scope is valid only at block-level scope
No variable promotion
Does not affect the scope chain
2.const constant declaration and features
Characteristics
Must have an initial value
General constants use uppercase
The value of constant cannot be modified
It's also block-level scope.
For the modification of arrays and objects, it does not count as the modification of constants, and will not report an error (arrays and objects can be modified, and the address pointed to has not changed)
3. Deconstruction of the assigned array of variables const RNG = ['uzi',' mlxg', 'letme',' ming'] let [a, b, c, d] = RNG;// each value is the deconstruction of the value object corresponding to the location of the array const UZI= {name: 'proud', age: 22, love: 'LOL', lol: function () {alert (' lol')}} let {name, age, love} = UZI / / each value is the corresponding value let {lol} = UZI;lol () in the object; / / use 4. Template string ``
Newline characters can appear directly in the content, single quotation marks and double quotation marks cannot be directly used by newline characters (need to be concatenated by quotation marks plus marks)
Let str = `lol s10 tes is the champion `; / / you can use newline characters directly in this way
Directly splice variables ${}
Let lol = 'Lol 10th Anniversary'; let uzi = `$ {lol} China won the championship `5. Object abbreviation let name = 'zhangning187';let change = function () {console.log (' try to change');} const supwisdom = {name, change} 6. Arrow functions and declaration features = > let fn = (a, b) = > {return a + b;} fn (1,2); / / 3
Characteristics
1.this is static. This always points to the value of th in the scope where the function is declared. It does not have its own this.
two。 Cannot be instantiated as a construction object
3. You cannot use the arguments variable
4. Abbreviation of arrowhead function
Omit parentheses, which can be omitted when there is only one parameter
Let add = n = > {return nasty 2;}
Omitting curly braces, when there is only one statement in the contemporary code body, return must be omitted, and the execution result of the statement is the return value of the function.
Let add = n = > nasty 2. The default shape parameter initial value of function parameter function add (a, b, c = 10) {/ / when c is not passed, the default value of c is 10. Try to put the parameter with default value after return a + b + c;} add (1,2); / 13 combined with deconstruction assignment function con ({name, age, love, height = '18'}) {/ / you can also give the default value console.log (age) / / 24 console.log (height); / / not passed, using the default value 18} con ({name: 'zhangning187', age: 24, love:' js'}) 8.rest parameter
Arguments used to get parameters, instead of arguments
The rest parameter is an array, unlike arguments in es5, where there is an object in arguments
How to get the argument
Function data (a, b,... args) {/ / rest parameter must be placed at the end of the parameter console.log (a); / / 1 console.log (b); / / 2 console.log (args); / / [3, 4, 5, 6, 7]} data (1, 2, 3, 4, 5, 6, 7); 9. Extension operator.
You can convert an array into a comma-separated sequence of parameters, split an array, and pass each item to a function as a separate sequence of parameters.
Const RNG = ['UZI',' MLXG', 'LETME',' MING']; console.log (... RNG) / / UZI MLXG LETME MING deconstructed sequence console.log (RNG); / / ['UZI',' MLXG', 'LETME',' MING'] returns an array const a = [1jue 2], b = [3jue 6]; const c = [... a,... b] / / [1, 2, 3, 6] 10.Symbol 's new primitive data type, which represents a unique value
It is the seventh data type of the javaScript language, a data type similar to a string.
Characteristics
The value of 1.Symbol is unique and is used to resolve naming conflicts.
2.Symbol values cannot operate with other data, nor can they operate on their own +-* /
Object properties defined by 3.Symbol cannot be traversed using for in loops, but you can use Reflect.ownKeys to get all the key names of the object
/ / create Symbollet s = Symbol (); / / s is invisible and internally achieve uniqueness let S2 = Symbol ('zhangning187'); / / the string in this is just a flag, and the values returned by Symbol are unique let S3 = Symbol (' zhangning187'); console.log (S2 = = S3) / / false, make sure the uniqueness / / Symbol.for () method is created, which is an object in which you can get a unique symbol value let S6 = Symbol.for ('zhangning187'); let S8 = Symbol.for (' zhangning187'); console.log (S6 = = S8); / / true get a unique symbol value
Object to add properties of type Symbol
Let zn = {up: function () {}, down: function () {}, name: 'zhangning187', age: 24} / / add the up down method / / zn.up = function () {} / / this can be added but is not sure whether the up method exists in the zn The original up method may be overwritten / / when you need to consider adding a unique method through Symbol / / declare an object let methods = {up: Symbol (), down: Symbol ()} zn [methods.up] = function () {console.log ('I can climb the stairs') } zn [methods.down] = function () {console.log ('I can go downstairs');} console.log (zn) / / the only method up down let UZI = {name: 'proud', / / Symbol (): function () {}, / / cannot be used directly here. Symbol () is an expression, a dynamic [Symbol ('lol')]: function () {console.log (' I can type lol'). }, [Symbol ('basketball')]: function () {/ / Symbol () can also add the description string console.log ('I can play basketball')}} console.log (UZI); 11. Iterator (Iterator)
An iterator is an interface that provides a unified access mechanism for different data structures. Any data structure can be traversed as long as the Iterator interface is deployed.
1.ES6 creates a new traversal command for...of loop, and the Iterator interface provides for...of consumption
two。 Native data with iterator interface
Array Arguments Set Map String TypedArray NodeList
3. working principle
A create a pointer object that points to the starting position of the current data structure
B calls the object's next method for the first time, and the pointer automatically points to the first member of the data structure.
C then keeps calling the next method, and the pointer moves back until it points to the last member
D return an object containing value and done properties per call to the next method
When customizing traversing data, think of iterators
twelve。 Declaration and call of generator function
Generator function is an asynchronous programming solution provided by ES6, which is completely different from traditional functions and is a special function.
/ declare that function * gen () {/ / * can be left or right, and can also be placed in the middle / / console.log ('hello'); yield' 2020lpl beef pie'; / / yield statement can be counted as a function code delimiter let two = yield 'uzi retired'; console.log (two); yield 'Lakers championship';} / execute let iterator = gen (); / / console.log (iterator) / / the returned result is an iterator object console.log (iterator.next ()); / / the next () method in the iterator object needs to be executed before the generator function console.log (iterator.next ()) is executed. / / each next () will execute only one yield statement inside, which will output 'uzi decommissioned' / / pass the parameter parameter will be the return result of the previous yield statement console.log (iterator.next ('AAA')); / / the parameter passed by the third call will be printed as the return result of the second yield as AAA// using for of loop traversal output for (let v of gen ()) {console.log (v) / / output the values in the yield statement in turn}
Case: 1s output 1112s output 2223s output 333
Function one () {setTimeout (()) = > {console.log ('111') iterator.next ();}, 1000)} function two () {setTimeout () = > {console.log (' 111') iterator.next () }, 1000)} function three () {setTimeout (() = > {console.log ('111')}, 1000)} / / Generator function function * gen () {yield one (); yield two (); yield three ();} / / call generator function let iterator = gen (); iterator.next (); basic use of 13.Promise
Promise is a constructor that encapsulates an asynchronous operation and can obtain its success or failure results.
1. Promise constructor Promise (excutor) {}
2. Promise.prototype.then has two parameters, both of which are functions
The successful state of the Promise object executes the first function in then, and the second function fails.
3 、 Promise.prototype.catch
/ / instantiate const p = new Promise ((resolve,reject) = > {/ / change the state of the Promise object through the two functions resolve,reject, / / resolve will change the state of p to success, reject will change the state of p to failure, and then execute the method / / in then to perform asynchronous operations, taking timers as an example Timer is also asynchronous setTimeout (() = > {/ / let data = 'async execution succeeded' / / resolve (data); / / call the resolve function, p becomes a successful state and executes the first method in then, let err = 'execution failed'; reject (err) / / call reject function, p will become a failed state and execute the second method in then}, 1000)}) / / promise object then method p.then will be called after success (value = > {/ / success / / console.log (value); / / console print: asynchronous execution succeeded}, reason = > {/ / failed console.error (reason)})
Promise.prototype.then characteristics
/ / the return result of the then method is the Promise object, and the state of the object is determined by the execution result of the callback function const p = new Promise ((resolve, reject) = > {setTimeout (()) = > {resolve ('success'); reject ('failure');}, 1000);}) The return result of / / then is a Promise object, that is, result is also a Promise object, and its state is determined by the result of the execution of the function const result = p.then (value = > {console.log (value); / / 1. If the returned result is an attribute of non-Promise type and the status is successful, the value / / in the return value return is not written as return. If return is not written inside the function, the result is undefined, nor is it a Promise object, and the status is also successful / / return 123; / / 2. Is a promise object, which determines that the then method returns the promise object state return new Promise ((resolve, reject) = > {/ / resolve ('ok'); / / then method returns promise object status as successful reject (' no'); / / then method returns promise object status as failed}) / / 3. Throw an error the then method returns the state of the promise object as a failure, and the error value is the wrong value throw new Error ('error');}, reason = > {console.err (reason);}); console.log (result) / / to sum up, the then method can be chained to change the phenomenon of the callback domain p.then (value= > {}, reason= > {}). Then (value () = > {}) .then ()
For example: after multiple requests are returned, get the data in them
Const p = new Promise ((resolve, reject) = > {resolve ('successful first return')}); p.then (value= > {return new Promise ((resolve, reject) = > {resolve ([value, 'successful second return'])})) }) .then (value= > {return new Promise ((resolve, reject) = > {resolve ([... value, 'success of the third return'])});}) .then (value= > {console.log (value); / / the return value is the value returned after all three requests have been successful); 14. Set set
The new data structure Set (collection) is similar to an array, where the values of members are unique, and the collection implements the iterator interface, so you can use the extension operator and for of to traverse
Properties and methods of the collection
1 size returns the number of elements in the collection
2 add add a new element to return the current collection
3 delete deletes the element and returns the Boolean value
4 has detects whether the collection contains an element and returns a Boolean value
5 clear clear
/ declare let s = new Set (); let S2 = new Set ([1,2,3,6,7]); console.log (S2); / / 5 s2.add (8); / / add new element console.log (S2); / / output {1,2,3,6,7,8} s2.delete (8); console.log (S2) / output {1, 2, 3, 6, 7} console.log (s2.has (8)); / / false / / s2.clear (); / / clear let arr = [1, 2, 3, 3, 3, 6, 6, 8]; let arr2 = [1, 3, 6, 7, 8]; / / Array deduplication let result = [. New Set (arr)] / / intersection let result = [... new Set (arr)] .filter (item = > new Set (arr2) .has (item)); / / Union let result = [... new Set ([... arr,... arr2])]; / / difference arr has no let result = [... new Set (arr)] .filter (item = >! (new Set (arr2) .has (item); 15.Map collection
Similar to objects, it is also a collection of key-value pairs, but keys are not limited to strings. Values of various types (including objects) can be used as keys.
Map also implements the iterator interface, so you can use the extension operator and for of to traverse
1 size returns the number of elements of Map
2 set adds a new element that returns the current Map
3 get returns the key value of the key name object
4 has detects whether the Map contains an element and returns a Boolean value
5 clear clears the collection and returns undefined
/ declare let m = new Map (); m.set ('name',' zhangning'); m.set ('change', function () {console.log (' get harder)}); / / key change value A function let key = {company: 'supwisdom'}; m.set (key, [1,2,3]); / / key object value array m.size / / get m m.delete ('name'); / / delete key-value pair m.get (' change'); / / get the value corresponding to the key / / m.clear (); / / clear for (let v of m) {console.log (v);} 16.class class
Classes can be defined through class, and the new class writing only makes the object prototype more clearly written, more like the syntax of object-oriented programming.
1 class declaration class
2 constructor defines constructor initialization
3 extends inherits the parent class
4 super calls the parent constructor
5 static defines static methods and properties
6 parent class methods can be overridden
Es5's method of instantiating an object through a constructor
/ / function People (name, sex) {this.name = name; this.sex = sex;} / / this height is added to a function object, not an instance object. This attribute is called static member People.height = '180; People.prototype.height1 =' 100'. / / add method People.prototype.play = function () {console.log ('playing basketball');} let zn = new People ('zhangning',' male'); zn.play (); / / output basketball playing console.log (zn); console.log (zn.height); / / output undefined console.log (zn.height1) / / output 100, which must be added through prototype before adding to the instance object
Implemented through class
Class People {/ / static attribute static. The method annotated by static belongs to the class, not the instance object static height = '100; static change () {console.log (' I can change the world') } / / the constructor name cannot be changed (the constructor method on the instance object is automatically executed when using new People) constructor (name, sex) {this.name = name; this.sex = sex } / / add method must use this syntax, cannot use the full form of es5 (play: function () {} this form is not supported, must use play () form) / / member attribute play () {console.log ('playing basketball');}} let zn = new People ('zhangning',' male'); console.log (zn) Console.log (zn.height); / / the method annotated by undefined static belongs to the class, not to the instance object console.log (People.height); / / 100
Using the es5 constructor to implement inheritance
/ / for example, chinese inherits the People attribute function People (name, sex) {this.name = name; this.sex = sex;} People.prototype.play = function () {console.log ('hit LOL') } function Student (name, sex, like, height) {/ / change the this value through the call method. This points to this in chinese, that is, an instance object People.call (this, name, sex) of chinese; this.like = like; this.height = height;} / / sets the subset constructor prototype Student.prototype = new People / / then there will be a parent method Student.prototype.constructor = Student;// to make a correction. Without this line of code, it doesn't matter / / declare the subclass method Student.prototype.photo = function () {console.log ('go to take a picture');} / / instantiate const zn = new Student ('zhangning',' male', 'playing basketball', '187'); console.log (zn)
Using es6 class classes to implement inheritance and parent method rewriting
/ / declare parent class class People {/ / parent class constructor constructor (name, sex) {this.name = name; this.sex = sex;} / / parent class member attribute play () {console.log ('hit LOL') }} / / declare that the subclass uses extends to inherit the parent class class Student extends People {/ / constructor constructor (name, sex, like, height) {super (name, sex); / / super is the constructor constructor of the parent class, so call this.like = like; this.height = height;} photo () {console.log ('go photo') } / / A pair of play methods in the parent class are overridden. The subclass cannot call the parent class method with the same name, play () {/ / super (); no, super () cannot call the parent class method with the same name in the ordinary member method, so it will report an error and can only completely rewrite console.log ('I can play LOL and basketball') }} const zn = new Student ('zhangning',' male', 'playing basketball', '187'); console.log (zn)
Getter and setter settings in class
Class People {get like () {return 'playing basketball';} set like (newVal) {/ / change like console.log ('change like value') by passing newVal value;}} let p = new People (); console.log (p.like) / / output basketball p.like = 'LOL' / / then operate via set like 17. Object numerical extension Object.is
Judge whether the two values are exactly equal
Object.is (1,1); / / true
Very similar to = = except that NaN = NaN is false and Object.is (NaN, NaN) is true
Object.assign
Merge of objects
Const C1 = {name: 'znn'}; const c2 = {name:' zhangning', height: 187}; Object.assign (C1, c2); / / if the same attribute exists in two objects, the attribute content Object.setPrototypeOf in C1 is overwritten in c2.
Set up prototype object
Const zn = {name: 'zhangning',} const p = {h: true, sfsfdf:' fasfasdf'} Object.setPrototypeOf (zn, p); / / set zn prototype with pObject.getPrototypeOf (zn); / / get zn prototype console.log (zn); / / print the following 18. Array extension Array.from ()
The Array.from method is used to turn two types of objects into real arrays: objects of class arrays (array-like object) and objects that can be traversed (iterable) (including ES6's new data structures Set and Map).
Let arrayLike = {'0forth:' asides, '1clients:' baked, '2percent:' cased, length: 3}; / / ES5 is written as var arr1 = [] .slice.call (arrayLike); / / ['averse,' baked,'c'] / / ES6 is written as let arr2 = Array.from (arrayLike) / / NodeList object let ps = document.querySelectorAll ('p'); Array.from (ps) .forEach (function (p) {console.log (p);}); / / arguments object function foo () {var args = Array.from (arguments) / /...} / / A string is converted into a character array str.split ('') Array.from ('hello') / / [undefined, undefined, undefined] let namesSet = new Set ([' averse,'b']) Array.from (namesSet) / / ['averse,' b'] Array.from ({length: 3}); / / [undefined, undefined, undefined]
For browsers that have not yet deployed this method, you can use the Array.prototype.slice method instead:
Const toArray = () = > Array.from? Array.from: obj = > [] .slice.call (obj) ()
Array.from can also accept the second parameter, which acts like the array's map method to process each element and put the processed value into the returned array.
Array.from (arrayLike, x = > x * x); / equivalent to Array.from (arrayLike) .map (x = > x * x); Array.from ([1je 2jue 3], (x) = > x * x) / / [1,4,9] / / Array.from callback function var arr1 = Array.from ([1m 2m 3], function (item) {return item*item;}) Var arr2 = Array.from ([1jue 2jue 3]) .map (function (item) {return item*item;}); var arr3 = Array.from ([1JI 2je 3], (item) = > item*item); console.log (arr1); / / [1,4,9] console.log (arr2); / / [1,4,9] console.log (arr3); / / [1,4,9]
It is worth reminding that the extension operator (...) can also convert some data structures to arrays.
/ / arguments object function foo () {var args = [... arguments];} / / NodeList object [... document.querySelectorAll ('div')] Array.of ()
The Array.of method is used to convert a set of values into an array. Array.of always returns an array of parameter values. If there are no arguments, an empty array is returned.
Array.of can basically be used instead of Array () or new Array (), and there is no overload due to different parameters. Its behavior is very uniform.
The main purpose of this method is to make up for the deficiency of the array constructor Array (). Because the number of parameters is different, the behavior of Array () will be different.
Array () / / [] Array (3) / / [,] Array (3,11,8) / / [3,11,8] Array.of () / / [] Array.of (3) / / [3] Array.of (3,11) Array.of (3). Length / / 1 Array.of (undefined) / / [undefined] Array.of (1) / / [1] Array.of (1,2) / / [1,2]
The Array.of method can be simulated with the following code:
Function ArrayOf () {return [] .slice.call (arguments);} find () and findIndex ()
The find method of the array instance, which is used to find the first qualified array member. Its argument is a callback function, which is executed by all array members in turn until the first member whose return value is true is found and then returned. If there are no eligible members, undefined is returned.
[1,4,-5,10] .find ((n) = > n)
< 0) // -5 [1, 5, 10, 15].find(function(value, index, arr) { return value >9;}) / / 10
In the above code, the callback function of the find method can take three parameters, in turn, the current value, the current position, and the original array. The use of the findIndex method of an array instance is very similar to the find method, returning the position of the first qualified array member, or-1 if none of the members match the condition.
[1,5,10,15] .findIndex (function (value, index, arr) {return value > 9;}) / / 2
Both methods accept the second parameter, which is used to bind the this object of the callback function.
In addition, both methods can find NaN, which makes up for the deficiency of the IndexOf method of the array.
[NaN] .indexOf (NaN) / /-1 [NaN] .findIndex (y = > Object.is (NaN, y)) / / 0fill ()
The fill () method populates an array with the given value.
['await,' baked,'c'] .fill (7) / / [7,7,7] new Array (3) .fill (7) / / [7,7,7] ['await,' baked,'c'] .fill (7, 1, 2) / / ['await, 7,' c']
The above code shows that the fill method is very convenient for initializing empty arrays. All existing elements in the array will be erased.
The fill () method can also accept the second and third parameters, which specify the start and end positions of the fill.
Fill (7, 1, 2) / / ['await, 7,' c'] entries (), keys () and values ()
ES6 provides three new methods-- entries (), keys (), and values ()-- for traversing arrays. They all return a traversal object that can be traversed with a for...of loop, except that keys () is the traversal of the key name, values () is the traversal of the key value, and entries () is the traversal of the key-value pair.
For (let index of ['asides,' b'] .keys ()) {console.log (index);} / 0 / / 1 for (let elem of ['asides,' b'] .values ()) {console.log (elem);} / /'a' / /'b' for (let [index, elem] of ['asides,' b'] .values ()) {console.log (index, elem) } / / 0 "a" / / 1 "b"
If you do not use a for...of loop, you can manually call the next method of the traversal object to traverse.
Let letter = ['averse,' baked,'c']; let entries = letter.entries (); console.log (entries.next () .value); / / [0,'a'] console.log (entries.next () .value); / / [1,'b'] console.log (entries.next () .value); / / [2,'c'] includes ()
In ES5, we often use the indexOf method of an array to check whether a value is included. IndexOf method has two disadvantages, one is not semantic enough, its meaning is to find the first occurrence position of the parameter value, so it is not intuitive to compare whether it is not equal to-1. Second, it uses the strict equivalent operator (=) internally to judge, which will lead to misjudgment of NaN.
[NaN] .indexOf (NaN) / /-1 includes uses a different judgment algorithm, and there is no such problem. [NaN] .vendor (NaN) / / true
The Array.prototype.includes method returns a Boolean value indicating whether an array contains the given value, similar to the includes method of a string. This method belongs to ES7, but the Babel transcoder already supports it.
[1, 2, 3] .NaN (2); / / true [1, 2, 3] .duration (4); / / false [1, 2, NaN] .cake (NaN); / / true
The second parameter of this method represents the starting position of the search, which defaults to 0. If the second parameter is negative, it represents the position of the reciprocal, and if it is greater than the array length (for example, the second parameter is-4, but the array length is 3), it will be reset to start at 0.
[1,2,3] .duration (3,3); / / false [1,2,3] .duration (3,-1); / / true
The following code is used to check whether the current environment supports this method, and if not, deploy a simple alternative version.
Const contains = () = > Array.prototype.includes? (arr, value) = > arr.includes (value): (arr, value) = > arr.some (el = > el = value) (); contains (["foo", "bar"], "baz"); / / = > false
In addition, the Map and Set data structures have a has method that needs to be distinguished from includes.
The has method of the Map structure is used to find key names, such as Map.prototype.has (key), WeakMap.prototype.has (key), and Reflect.has (target, propertyKey).
The has method of the Set structure is used to find values, such as Set.prototype.has (value), WeakSet.prototype.has (value).
The vacancy of an array
The vacancy of an array means that there is no value at a certain position in the array. For example, the array returned by the Array constructor is empty.
Note that the vacancy is not undefined, and the value of a position is equal to undefined, which is still valuable. Spaces have no value, as can be illustrated by the in operator.
0 in [undefined, undefined, undefined] / / true0 in [,] / / false
The above code shows that the 0 position of the first array has a value, and the 0 position of the second array has no value.
ES5's handling of vacancies is already very inconsistent, and vacancies are ignored in most cases.
ForEach (), filter (), every (), and some () all skip spaces.
Map () skips spaces, but retains this value
Join () and toString () treat vacancies as undefined, while undefined and null are treated as empty strings.
/ / forEach method [,'a'] .forEach ((xmemi) = > console.log (I)) / / filter / every method [,'a'] / / false// map method [,'a'] .map (x = > 1) / / join method [,'a'] / join method [,'a'] / false// map method [,'a'] .map (x = > 1) / [, 1] / join method [,'a'] Null] .join ('#') / / "# adept #" / / toString method [, 'axiomagenical undefined _ null] .toString () / / ", acentine,"
On the other hand, ES6 explicitly converts vacancies into undefined.
/ / the Array.from method converts the empty space of the array to undefined, that is, this method does not ignore the empty space. The Array.from (['a', undefined, "b"] / / extension operator (...) also converts spaces to undefined. [...] / / ["a", undefined, "b"] / / copyWithin () will be copied with vacant space. [,] .copyWithin (2 fill 0) / / [, "a", "a"] / copyWithin () treats spaces as normal array positions. The new Array (3) .fill ('a') / / ["a", "a", "a"] / / for...of loop also traverses empty spaces. Let arr = [,]; for (let i of arr) {console.log (1);} / 1 / 1 / / in the above code, the array arr has two empty spaces, and for...of does not ignore them. If the traversal is changed to the map method, the empty space will be skipped. / / entries (), keys (), values (), find (), and findIndex () process vacancies as undefined. / / entries () [. [,'a'] .values ()] / / [[0 undefined undefined], [1, "a"]] / / keys () [. [,'a'] .keys ()] / / [0J 1] / / values () [. [,'a'] .values ()] / [undefined, "a"] / / find () [ 'a'] .find (x = > true) / / undefined / / findIndex () [,'a'] .findIndex (x = > true) / / 0 / / because the rules for handling vacancies are very inconsistent Therefore, it is recommended to avoid vacant seats. These are all the contents of the article "what are the ES6 interview questions?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.