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

144
Views
Source has 5 element(s) but target allows only 0

The typescript show this error:

Source has 5 element(s) but target allows only 0

Test.ts

await Map.createPoint("New York",[[323, 232],
      [123, 233],
      [221, 455],
      [321, 212],
      [122, 253]]);

Map.ts


class Map{
  async createGeofencesTest(city:string,points:[]): Promise<void> {
    await Admin.setGeofenceCity(city); 
    await Admin.Points(points);
    return;
  }
}

what am I doing wrong?

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

0

The type [] is an array with 0 elements. You need either number[][] or [number, number][].

number[][] is an array of arrays of numbers.

[number, number][] is an array of [number, number]. [number, number] is an array with exactly two numbers.

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!