You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a function <code>createHelloWorld</code>. It should return a new function that always returns <code>"Hello World"</code>.
2
+
<p> </p>
3
+
<p><strongclass="example">Example 1:</strong></p>
4
+
5
+
<pre>
6
+
<strong>Input:</strong> args = []
7
+
<strong>Output:</strong> "Hello World"
8
+
<strong>Explanation:</strong>
9
+
const f = createHelloWorld();
10
+
f(); // "Hello World"
11
+
12
+
The function returned by createHelloWorld should always return "Hello World".
13
+
</pre>
14
+
15
+
<p><strongclass="example">Example 2:</strong></p>
16
+
17
+
<pre>
18
+
<strong>Input:</strong> args = [{},null,42]
19
+
<strong>Output:</strong> "Hello World"
20
+
<strong>Explanation:</strong>
21
+
const f = createHelloWorld();
22
+
f({}, null, 42); // "Hello World"
23
+
24
+
Any arguments could be passed to the function but it should still always return "Hello World".
0 commit comments