Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emilwijayasekara/leetcode-2667-create-hello-world-function-30-days-of-javascript-day-1
LeetCode Problem 2667. Create Hello World Function - In this problem we have to write a function createHelloWorld. It should return a new function that always returns "Hello World".
https://github.com/emilwijayasekara/leetcode-2667-create-hello-world-function-30-days-of-javascript-day-1
javascript leetcode leetcode-solutions
Last synced: 2 days ago
JSON representation
LeetCode Problem 2667. Create Hello World Function - In this problem we have to write a function createHelloWorld. It should return a new function that always returns "Hello World".
- Host: GitHub
- URL: https://github.com/emilwijayasekara/leetcode-2667-create-hello-world-function-30-days-of-javascript-day-1
- Owner: EmilWijayasekara
- Created: 2023-12-18T18:08:45.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-18T18:24:39.000Z (11 months ago)
- Last Synced: 2024-11-13T01:07:09.889Z (2 days ago)
- Topics: javascript, leetcode, leetcode-solutions
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LeetCode (30 Days of JavaScript)
## About the problem
- *Problem Number* : 2667
- *Problem Name* : [Create Hello World Function](https://leetcode.com/problems/create-hello-world-function/)
- *Problem difficulty* : Easy 🟢
- *Programming language used* - JavaScript## Problem
Write a function createHelloWorld. It should return a new function that always returns "Hello World".
Example 1:
```cpp
Input: args = []
Output: "Hello World"
Explanation:
const f = createHelloWorld();
f(); // "Hello World"
```
The function returned by createHelloWorld should always return "Hello World".`Example 2:
```cpp
Input: args = [{},null,42]
Output: "Hello World"
Explanation:
const f = createHelloWorld();
f({}, null, 42); // "Hello World"
```
Any arguments could be passed to the function but it should still always return "Hello World".
Constraints:
`0 <= args.length <= 10`## Approach Explanation
Solved using high order function 👍### If you have suggestions for improvement or would like to contribute to this solution, feel free to create a pull request. 🙌😇