Day 0: Hello, World! – 10 Days of Javascript – HackerRank Solutions

Embarking on the coding odyssey, we delve into the intricacies of Day 0: Hello, World!, an integral part of the 10 Days of JavaScript series on HackerRank. This article not only provides a solution but also serves as a foundational guide for those venturing into the realm of JavaScript.

Day 0: Hello, World! | Problem

As an experienced developer, I want to share my perspective on the Day 0 “Hello, World!” challenge. Frankly, this is the most convoluted “Hello, World!” exercise ever, I’d expect beginners to somewhat struggle when a Hello World exercise should be just for teaching the very basic syntax.

greeting function is provided for you in the editor below. It has one parameter, . Perform the following tasks to complete this challenge:

  1. Use console.log() to print Hello, World! on a new line in the console, which is also known as stdout or standard output. The code for this portion of the task is already provided in the editor.
  2. Use console.log() to print the contents of  (i.e., the argument passed to main).

Day 0: Hello, World! | HackerRank Solution

function greeting(parameterVariable) {
    console.log('Hello, World!');
    console.log(parameterVariable);
}

Day 0: Hello, World! | Output

// parameterVariable = "Welcome to 10 Days of JavaScript!";

Hello, World!
Welcome to 10 Days of JavaScript!

Problem Link: https://www.hackerrank.com/challenges/js10-hello-world/problem

Photo of author

Shreya Singh

Hey there, I'm Shreya Singh, your friendly coding enthusiast and interview prep buddy! I'm on a mission to make coding and job interviews less daunting and more exciting. With a background in computer science and a passion for problem-solving, I love sharing tips and tricks that I've picked up along the way.

Leave a comment