Replace Loop with Pipeline

refactorgram

  const names = [];
  for (const i of input) {
    if (i.job === “programmer”)
      names.push(i.name);
  }

image/svg+xml

  const names = input
    .filter(i => i.job === “programmer”)
    .map(i => i.name)
  ;