In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what is the use of some in es6". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In es6, the function of some is to detect whether the specified element exists in the array; if there is a specified element, the result is true; if there is no specified element, the result is false, and the syntax is "array.some (callback function), thisValue)".
This article operating environment: windows10 system, Vue2.9.6 version, DELL G3 computer.
What is the function of some in es6
The some () method tests whether an element in the array passes the test implemented by the provided function.
Grammar
Array.some (callback [, thisObject])
Parameter details
Callback-Test the function of each element.
ThisObject-the object that is used as this object when the callback is performed.
Return value
Returns true if an element passes the test, false otherwise.
Example
Function isBigEnough (element, index, array) {return (element > = 10);} var retval = [2,5,8,1,4] .some (isBigEnough); console.log ("Returned value is:" + retval); var retval = [12,5,8,1,4] .some (isBigEnough); console.log ("Returned value is:" + retval)
Output
This is the end of the content of "what is the use of some in es6". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.