JavaScriptSyntax
Filter an Array
Code example
nums.filter((n) => n > 0)Keeps only items that pass a test.
In JavaScript, filter an array: keeps only items that pass a test — nums.filter((n) => n > 0)
nums.filter((n) => n > 0)nums.filter((n) => n > 0)Keeps only items that pass a test.
Use nums.filter((n) => n > 0).
Use this pattern: nums.filter((n) => n > 0)
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.