Hello, World! in Javascript

Day 0: Hello, World! in Javascript| HackerRank Solutions

Hello, World! in Javascript!!!

Hello programmers, today we are sharing proper solutions with all test cases passed of 10 Days of JavaScript by HackerRank.

As you all know JavaScript is the most popular and the most challenging programming language to conquer but nowadays it’s not. There are some amazing platforms where they provide challenges on different languages and HackerRank is one of them.

If you don’t know about HackerRank then HackerRank is a community of software engineers and data science enthusiasts.

Their aim is to improve coding skills, learn new technology stacks, develop competitive programming strategies and have fun doing it. It is a technology platform that provides its users with ways to test their programming skills, accesses new technology stacks, exercise for competitive programming, and improve their overall interaction with the world of technology.

The same way they have created 10 days of JavaScript. In this post, we have started giving solutions every day. Let’s start with the 0th day i.e. Hello, World!. We are providing a proper solution with all test cases passed so you don’t have to worry about the solution.

Before checking out the solution it’s highly recommended to do it by yourself first because these challenges will help you to think about how to deal with these real-world problems.

Let’s get started.

Here are a couple of related posts you may find helpful, too:

  1. How to make money through coding? 9 Easy Ways To Make Money.
  2. 15+FREE Stuff For College Students Using Your College ID.
  3. how to get rich by coding? I make $100 every month from coding

Problem: Hello, World! in Javascript

Hello, World! in Javascript

Overview: 10 Days of JavaScript

This series focuses on learning and practicing JavaScript. Each challenge comes with a tutorial article, and you can view these articles by clicking either the Topics tab along the top of the article icon in the right-hand menu.

Objective

In this challenge, we review some basic concepts that will get you started with this series. Check out the tutorial to learn more about JavaScript’s lexical structure.

Task

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).

You’ve got this!

Input Format

Data TypeParameterDescription
stringparameterVariableA single line of text containing one or more space-separated words.

Output Format

Print the following two lines of output:

  1. On the first line, print Hello, World! (this is provided for you in the editor).
  2. On the second line, print the contents of parameterVariable.

Sample Input 0

Welcome to 10 Days of JavaScript!

Sample Output 0

Hello, World!
Welcome to 10 Days of JavaScript!

Explanation 0

We printed two lines of output:

  1. We printed the literal string Hello, World! using the code provided in the editor.
  2. The value of parameterVariable passed to our main function in this Sample Case was Welcome to 10 Days of JavaScript!. We then passed our variable to console.log, which printed the contents of parameterVariable.

Output

function greeting(parameterVariable) {
    // This line prints 'Hello, World!' to the console:
    console.log('Hello, World!');

    // Write a line of code that prints parameterVariable to stdout using console.log:
    console.log(parameterVariable);
}

If you’d like to see some more articles, be sure to read more blogs so you can keep up to date with the latest design tutorials and tricks.

To contact me here’s my Instagram link: untied_blog

Read more

  1. how to get rich by coding? I make $100 every month from coding
  2. How To Create An App Without Coding| Build an App In 5 Minutes
  3. 11 Amazing ReactJS Projects Ideas For Beginners with Source Code
  4. How To Answer “Tell Me About Yourself”| Interview Questions.
  5. How To Answer “Strengths And Weaknesses” (Interview Questions)
  6. “Why Should We Hire You” 7+ Best Answers Examples

Leave a Comment