Hello; Hello World; World

Published by Matt in

Write a function that takes an integer and:

  • If the number is a multiple of 3, return "Hello".
  • If the number is a multiple of 5, return "World".
  • If the number is a multiple of both 3 and 5, return "Hello World".

Examples

helloWorld(3) ➞ "Hello"

helloWorld(5) ➞ "World"

helloWorld(15) ➞ "Hello World"

Notes

Don't forget to return the result.

Watch a quick demo on how Edabit works.