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

188
Views
TCS javascript: technical written question

I don't know what is the output of this and how the flows go to solve it

console.log(60+"20" - 20*20);

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

0

JS implicitly converts number + string = string

Therefore, 60+"20" = "60"+"20" = "6020"

let a = "60"+20;
console.log(a, typeof a)


Then, JS implicitly converts string - number = number

Therefore, "6020" - 20*20 = "6020" - 400 = 6020-400 = 5620

let a = "6020" - 20*20;
console.log(a, typeof a)

Note: You can check datatype as well of each result for clarity of each result after conversion

about 4 years ago · Juan Pablo Isaza Report

0

Well it gets processed as follows:

60+"20" becomes 6020
20*20 = 400
6020-400 = 5620
about 4 years ago · Juan Pablo Isaza Report

0

output : 5620

20*20 = 400 ->1st
60+'20' = 6020 -> 2nd
6020 - 400 = 5620 -> 3rd
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!