What is the use of the filter () method in JavaScript
Editor to share with you what is the use of the filter () 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!
Filter ()
It is used to filter out some elements of Array and return the remaining elements.
Var str1 = [1 return (x) {return x > 2}] console.log (function (x) {5) > 2}) / / [3 var str1 4 () what is the use of filter () method in JavaScript? thank you for your 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!