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

182
Views
La propiedad 'esto' no existe en el tipo '{ tipo: cadena | nulo; ubicación: cadena | nulo; }'. mientras se desestructura la tarea

En mi aplicación angular, tengo una función que básicamente devuelve un objeto.

 private getTypeAndLocation() { const type = sessionStorage.getItem('type'); const location = sessionStorage.getItem('location'); return {type, location}; }

Ahora estoy llamando a esta función desde ngOnint así:

 ({this.MyObjectVariable.type, this.MyObjectVariable.location} = this.getWorkClearanceTypeAndLocation());

Pero desafortunadamente no funciona. Estoy recibiendo este error:
Property 'this' does not exist on type '{ type: string | null; location: string | null; }'.

Es posible que getTypeAndLocation devuelva undefined si el tipo y la ubicación no están configurados.

En ese caso, ¿cómo puedo hacer la desestructuración del objeto?

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