# JavaScript Code Daily Challenge #2 Lakshya Tyagi Updated on ・1 min read

This is a series of JavaScript Code Daily Challenge. Each day I show a few solutions written in JavaScript. The questions are from coding practice/contest sites such as HackerRank, LeetCode, Codeforces, Atcoder and etc.

``````'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});

process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});

main();
});

return inputString[currentLine++];
}
``````

Complete the function in comment

``````function performOperation(secondInteger, secondDecimal, secondString) {
// Declare a variable named 'firstInteger' and initialize with integer value 4.
const firstInteger = 4;

// Declare a variable named 'firstDecimal' and initialize with floating-point value 4.0.
const firstDecimal = 4.0;

// Declare a variable named 'firstString' and initialize with the string "HackerRank".
const firstString = 'HackerRank ';

// Write code that uses console.log to print the sum of the 'firstInteger' and 'secondInteger' (converted to a Number        type) on a new line.

// Write code that uses console.log to print the sum of 'firstDecimal' and 'secondDecimal' (converted to a Number            type) on a new line.

// Write code that uses console.log to print the concatenation of 'firstString' and 'secondString' on a new line. The        variable 'firstString' must be printed first.

}
``````
``````function main() {

performOperation(secondInteger, secondDecimal, secondString);
}
``````

### Discussion  Lakshya Tyagi
``````    function performOperation(secondInteger, secondDecimal, secondString) {
const firstInteger = 4;
const firstDecimal = 4.0;
const firstString = 'HackerRank ';

const sum=firstInteger+parseInt(secondInteger);
console.log(sum)

console.log(firstDecimal+parseFloat(secondDecimal))

console.log(firstString+secondString)
}
`````` Joachim Zeelmaekers

Nice read! If you want to improve the readability you can use `js` to the first 3 backticks to add syntax highlighting! It would look like this:

``````function main() {