Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- function makeCar(color) {
- return {
- getColor() { return color; }, // Читает color
- paint(newColor) { color = newColor; }, // Изменяет color
- }
- };
- global.cars = ['red', 'green', 'blue'].map(makeCar);
- })();
Add Comment
Please, Sign In to add comment