---
# System prepended metadata

title: 2667. Create Hello World Function
tags: [Closure, leetCode]

---

# 2667. Create Hello World Function

###### tags:`Closure` | `leetCode`
<font color="#01AE9A" background="E1F3F0">`easy`</font>
 
### 題目
Write a function createHelloWorld. It should return a new function that always returns "Hello World".
### Example
```
Input: args = []
Output: "Hello World"
Explanation:
const f = createHelloWorld();
f(); // "Hello World"

The function returned by createHelloWorld should always return "Hello World".
```

### Constraints:
- `0 <= args.length <= 10`

---
### 解題邏輯
這題要我們寫一個函示，並且此 a 函式要回傳另一個 b 函式且 b 函式永遠回傳 "Hello World"
```javascript
var createHelloWorld = function() {
      return ()=>"Hello World"
};
```
<!-- {%hackmd @themes/orangeheart %} -->
{%hackmd @themes/dracula %}