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)
}
Explanation:-
- Here just the basic console logs are used.
- 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)
cold brothers and Keep Fight Brothers :)
In your opinion, what advantage does js provides over other language?
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.