filteredForEach(
[1, 2, 3, 4, 5],
(value) => value > 3,
(value) => console.log(value ** 2)
) // Prints: 16, 25
import { isString } from 'uft'
filteredForEach(
['foo', { a: 1 }, [], 'bar'],
isString,
(value) => {
value // type: string
console.log(value.toUpperCase())
}
) // Prints: FOO, BAR
Applies a filter function to the elements of the given array, and then
calls a forEach function with each of the filtered elements.
filteredForEach(
[1, 2, 3, 4, 5],
(value) => value > 3,
(value) => console.log(value ** 2)
) // Prints: 16, 25
import { isString } from 'uft'
filteredForEach(
['foo', { a: 1 }, [], 'bar'],
isString,
(value) => {
value // type: string
console.log(value.toUpperCase())
}
) // Prints: FOO, BAR
Applies a filter function to the elements of the given array, and then
calls a forEach function with each of the filtered elements.
filteredForEach(
[1, 2, 3, 4, 5],
(value) => value > 3,
(value) => console.log(value ** 2)
) // Prints: 16, 25
import { isString } from 'uft'
filteredForEach(
['foo', { a: 1 }, [], 'bar'],
isString,
(value) => {
value // type: string
console.log(value.toUpperCase())
}
) // Prints: FOO, BAR
Applies a
filterfunction to the elements of the given array, and then calls aforEachfunction with each of the filtered elements.