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

115
Views
How do I get results?

I am a beginner in JavaScript and I write the following code, I also write console.log(), and I do not get results, can someone help me and explain to me why I can't get results?

function integers() {
    let MyArray;
    MyArray = [];

    for (let i = 2; i <= 10; i++) {
        MyArray.push(i);
    }
    console.log(MyArray);
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The javascript functions are not being called automatically. If you need to do so, You can create an auto call function - https://stackoverflow.com/a/10704006/7078456

Or you can manually call your function to get the output of your function.

function integers() {
    let myArray = [];

    for (let i = 2; i <= 10; i++) {
        myArray.push(i);
    }

    console.log(myArray);
}

integers()
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!