Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
Why I get an error as "redeclaration of const phone_price" in console?

Question1: Why do I get this error on my browser(firefox):

redeclaration of const phone_price

enter image description here

But here, An error is not thrown:

const phone_price = 102.22;
const tax = 0.08;
const price_thereshold = 230;
const accessory = 10;

var account_bank = 310;
var amount = 0;

function withTax(amt){
  return amt * tax;
}
function formatted_price(amt){
  return "$" + amt.toFixed(2);
}

while(amount < account_bank){
  amount = amount + phone_price;
  if(amount < price_thereshold){
    amount = amount + accessory;
  }
}

amount = amount + withTax(amount);
amount = formatted_price(amount);

console.log("your purchase price: " + amount);

if(amount > account_bank){
  console.log("you haven't afford for your purchase");
}

Question 2: Why does the second console not run?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!