ਨੈੱਟ WPM0
WPM0
ਸ਼ੁੱਧਤਾ100%
ਬੀਤ ਗਈ0s
ਸਮਾਂ—
ਅੱਖਰ0
ਗਲਤ0
ਗਲਤੀਆਂ0
ਪ੍ਰਗਤੀ0%

Shift + Enter · ਸਟਾਰਟ / ਰੀਸਟਾਰਟ

ਕੋਡ ਪ੍ਰੋਂਪਟ ਗਾਈਡ ਪੜ੍ਹੋ
ਪ੍ਰੋਗਰਾਮਿੰਗ ਭਾਸ਼ਾ
JavaScript
ਮੁਸ਼ਕਿਲ
ਮਾਧਿਅਮ

Filter active records and return their names.

const users = [
  { name: "Ari", active: true },
  { name: "Bea", active: false },
  { name: "Kai", active: true },
];

const names = users
  .filter((user) => user.active)
  .map((user) => user.name);