New Javascript Array Filter Multiple Conditions In R