2809. Create Hello World Function
My accepted JavaScript solution to LeetCode problem 2809, Create Hello World Function, running in 46ms.
- Difficulty: Easy
- JavaScript
- Runtime 46ms
- Memory 53.2MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
JavaScript
Accepted on LeetCode — runtime 46ms, memory 53.2MB, accepted 2025-12-31.
/**
* @return {Function}
*/
var createHelloWorld = function() {
return function(...args) {
return "Hello World";
}
};
/**
* const f = createHelloWorld();
* f(); // "Hello World"
*/