10 Days of JavaScript (Day 0) HackerRank Solution #10daysofjavascript

 DAY 0: Hello, World!

Solution >>>

function greeting(parameterVariable) {

  console.log("Hello, World!");

  console.log(parameterVariable);

}



DAY 0: Data Types

Solution >>>

function performOperation(secondInteger, secondDecimal, secondString) {

  const firstInteger = 4;

  const firstDecimal = 4.0;

  const firstString = "HackerRank ";

  console.log(firstInteger + Number(secondInteger));

  const firstNum = Number(firstDecimal).toFixed(2);

  const secondNum = Number(secondDecimal).toFixed(2);

  const answer = Number(firstNum) + Number(secondNum);

  console.log(answer);

  console.log(firstString + secondString);

}

Comments

Popular posts from this blog

Introduction to the Internet of Things and Embedded Systems (Week 2)

The Arduino Platform and C Programming (Week 1)