Hello Exercism community!
I’d like to propose improvements to the closures concept explanation in the JavaScript track, specifically for the Coordinate Transformation exercise.
Current Situation:
-
While learning closures, I noticed a gap between the theoretical explanation and the practical exercise
-
The current introduction could benefit from more concrete examples
Proposed Improvements:
- Added Function Factory Examples:
function createMultiplier(factor) {
return function(number) {
return number * factor;
};
}
2-Added Practical Coordinate Transformer Example:
function createCoordinateTransformer(scaleX, scaleY) {
return function(x, y) {
return {
x: x * scaleX,
y: y * scaleY
};
};
}
3- Added Key Concepts section to bridge theory and practice
Benefits:
- Clearer progression from basic to advanced concepts
- Direct connection to the exercise’s requirements
- Better understanding of how closures work in practical scenarios
Link of PR