S
Seoffix.com
Sign In Get Pro Membership

JavaScript & TypeScript

Array Methods

Intermediate JavaScript 30 XP

Array Methods

map transforms every item and filter keeps the ones that pass a test.

Example

const big = [1, 5, 9].filter(n => n > 4);
console.log(big.join(","));

Your task

Double each number in the list with map and log them joined by commas.

Hints

  1. nums.map(n => n * 2)
  2. Join with .join(",")

Check your understanding

Answer every question to pass.
1. Which method keeps only items that pass a test?

Live playground

Press Run to see the result.

AI Code Explainer & Translator

Runs without any outside service.
 
Mark Complete & Earn XP
Earn 30 XP after you pass the quiz. Finish every lesson in the track to earn its certificate.
Sign in to earn XP