closures example completed for js