Map Property Values
Map Property Values
map is often the bridge from full records to the one field another part of the app needs. The callback should describe what one record becomes, and the method repeats that transformation for the whole array.
This matters in routing, analytics, and UI lists where the next step needs identifiers rather than full objects. Returning from the callback is what creates each slot in the new array.
Your task: Complete getLessonIds so it returns each lesson's id in order. The function should work for any lesson list, including an empty one, and it should not change the lesson objects.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Map Property Values
map is often the bridge from full records to the one field another part of the app needs. The callback should describe what one record becomes, and the method repeats that transformation for the whole array.
This matters in routing, analytics, and UI lists where the next step needs identifiers rather than full objects. Returning from the callback is what creates each slot in the new array.
Your task: Complete getLessonIds so it returns each lesson's id in order. The function should work for any lesson list, including an empty one, and it should not change the lesson objects.