DEV Community

pranav589
pranav589

Posted on

Day-0: 30 days of code- Hackerrank

Alt Text

Hello guys. I have started to solve the 30 days of code challenge on HackerRank using javascript. I'm gonna post the solutions of all the challenges with some key points to understand the solution.
So let's get started.

Day-0

Task:-

'To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line.'

Solution:-

function processData(inputString) {
    // This line of code prints the first line of output
    console.log("Hello, World.");

    //Write the second line of output that prints the contents of 'inputString' here.
    console.log(inputString)
}

Enter fullscreen mode Exit fullscreen mode

Explanation:-

  1. Here just the basic console logs are used.
  2. The second console log prints the content in the 'inputString' which is given as a parameter to the function.

Thank you!! Stay tuned!!

Top comments (3)

Collapse
 
ramdoni007 profile image
Anak Esemka Software Engginering 4ever

cold brothers and Keep Fight Brothers :)

Collapse
 
otumianempire profile image
Michael Otu

In your opinion, what advantage does js provides over other language?

Collapse
 
pranav589 profile image
pranav589

Js is one of the few languages that can be used for the frontend and backend. It can be used for web, mobile and desktop apps as well. Hence, due to its versatile applications, its one of the best out there. And also if you have a look at the community backing the language, its is very high.