

JS Array Transformer
Write a function transformClouds(clouds, minHeight) that takes an array of cloud objects { name: string, height: number } and a number minHeight. It should:
- Filter out clouds with heights strictly less than
minHeight. - Map the remaining clouds to return an array of their name strings in uppercase.
- Return this array.
If no clouds match, return an empty array.
Examples
transformClouds([{ name: "cumulus", height: 3000 }, { name: "cirrus", height: 6000 }, { name: "stratus", height: 1500 }], 3000)
→ ["CUMULUS", "CIRRUS"]
transformClouds([{ name: "fog", height: 200 }], 1000)
→ []
solution.js
JAVASCRIPT
Saved as you type
Tests
0 of 3 passing- •filter and uppercasetransformClouds([{ name: "cumulus", height: 3000 }, { name: "cirrus", height: 6000 }, { name: "stratus", height: 1500 }], 3000)expected ["CUMULUS", "CIRRUS"]
- •all filtered outtransformClouds([{ name: "fog", height: 200 }], 1000)expected []
- •empty array inputtransformClouds([], 500)expected []
On the line
+50 XP
Pass all 3 tests to claim it.
