Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the use of the includes () method in JavaScript

Shulou Source: shulou.com Published: 2022-06-01 03:08:57 09月22日 Update

Editor to share with you what is the use of the includes () method in JavaScript, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Includes ()

Includes () checks whether the array contains the specified element. The second parameter can specify where to start the detection.

Var str1 = [1 str1.includes (2))] console.log (2) / true is all the content of this article "what is the use of includes () method in JavaScript". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Articles methods content not so location elements parameters most arrays more knowledge industry information information channels channels references learning help inspection detection Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Information Shulou Tech Info Microsoft macOS