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

186
Views
How to correctly calculate a variable inside of a parameter

The following is javascript code and I'm using mozilla browser while hosting a localhost:

var test = 1; 
    console.log ("results are as such : "+ test-1 +". What we got instead is: "+ test+2 +". Astonishing!");
//The results: ("NaN. What we got instead is: 12. Astonishing!")

Doing a "Console.WriteLine("results are as such : "+ test-1 +". What we got instead is: "+ test+2 +". Astonishing!"); Will do exactly what I want it to in C# (Showing the text in quotation marks, and then showing the results of 1-1 =0, and 1+2 = 3), I'm less familiar with how it works in JavaScript, and I can't find any answers while browsing.

Can I get a hand please?

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

0

console.log(`result are as such: ${test} - 1 = ${test - 1}. and ${test} + 2 = ${test + 2}`);
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!