DevCircle Africa Logo

+ 776 578 583

info@devcircleafrica.com

Create Hello World Function

Javascript

Write a function createHelloWorld. It should return a new function that always returns "Hello World".

Example 1:

Input: args = []
Output: "Hello World"
Explanation:
const f = createHelloWorld();
f(); // "Hello World"

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

Example 2:

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

BELOW IS THE STARTING POINT

hello world function

Try it by yourself.

If you get into problem, you can check the solution or join our Developer Community where you can get more helps from the team and others doing the same challenges or you can simply comment below here and will be more than happy to assist.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.