How JavaScript uses the Array.isArray () method
Editor to share with you how JavaScript uses the Array.isArray () method, 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!
Use the Array.isArray () method
As the name implies, this method can be used to identify whether a given parameter is an array, and it returns a Boolean value (true/false) and the result.
For example, the Array.isArray () method can correctly determine whether it is an array using the following variables:
Let result = {subject: "Science", marks: 97}; / / Objectlet numbers = [1,2,3,4,5]; / Arraylet name = "Mark"; / / Stringlet names = new Array ("Jill", "Jane", "Jacqueline"); console.log (Array.isArray (result)); / / falseconsole.log (Array.isArray (numbers)); / / trueconsole.log (Array.isArray (name)); / / falseconsole.log (Array.isArray (names)) / / true above is all the content of the article "how JavaScript uses the Array.isArray () method". 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!