aya abdelhakeem
aya abdelhakeem

Reputation: 21

why do i get a syntax error from the console?

why do i get a syntax error from the console ? it is telling me that the secondInteger has already been declared but i declared it just once

function performOperation(secondInteger, secondDecimal, secondString) {
   const firstInteger = 4;
   const firstDecimal = 4.0;
   const firstString = "HackerRank "
   const secondInteger=5;
   const secondDecimal=2.0;
   const secondString="hacking rank";
  console.log(firstInteger+ secondInteger); 
  console.log(firstDecimal+secondDecimal);
  console.log(firstString+secondString);}

Upvotes: 0

Views: 49

Answers (1)

Quentin
Quentin

Reputation: 943625

Argument names are variable declarations so you declare it twice.

  1. On line 1 as an argument name
  2. Again on line 5 as a const

Upvotes: 3

Related Questions