Adrian Emil Tudorache developer
—
by
The correct way is by using the array.filter method.
Check it here