(new[] { 1, 5, 6, 8, 33, 15, 212, 432, 244224, 131, 33225, 888, 64, 89, 101 })
.Where(x => x % 2 == 0)
.ToList()
.ForEach(x => Console.WriteLine(x));
In js it's even easier:
[1, 5, 6, 8, 33, 15, 212, 432, 244224, 131, 33225, 888, 64, 89, 101 ].filter((el) => (el % 2 == 0)).forEach(el => console.log(el))
No comments:
Post a Comment