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

124
Views
Why is the b same as c at the console.log part? B should be same as c after the console.log

im trying to assign b to c after using c in the calculation, they cant be equal at the same time right now the console.log returns them both with the same number

let b = 1,
  c = 1;

for (i = 0; i < 8; i++) {
  let a = b + c;
  c = a;

  a = b + c;

  console.log(b);
  console.log(c);

  b = c;
}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Its not the same, just add some separation to see in console.

let b = 1,
  c = 1;

for (i = 0; i < 8; i++) {
  let a = b + c;
  c = a;

  a = b + c;

  console.log(b);
  console.log(c);
  console.log('-------------------------');
  b = c;
}

about 4 years ago · Juan Pablo Isaza Report
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!