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

140
Views
mecanografiado extender nueva propiedad sin modificar el tipo existente

tengo este codigo

 type VehicleDetails = {made: string} function doSomethingWithVehicleDetails (details: VehicleDetails) { //what to add here for newProperty? console.log(details); } doSomethingWithVehicleDetails({ made: '123', newProperty: true })

https://www.typescriptlang.org/play?noUncheckedIndexedAccess=true&target=99&useUnknownInCatchVariables=true&exactOptionalPropertyTypes=true#code/FDAuE8AcFMAIDVoAsCWBjANtAItUBDFDAZ1gF5YBvAW3wBNoAuWY0AJxQDsBzAXxABmAV05pQKAPadYdCQGUJ1PKh4B1FKCSJUmHHkIlYACgYEixZtvRZcZkgEoqsAPTOA7knyhYoCbHp0sEjQbHACEmywnNBuAApsEjBsEAD8wLCwaFLEElgAdBgS3Cb65vYA3MD8wLIKSppc3OqaVrq2BsRGlLC0DMwA5ACMAEwAzP0ANFEx8YkhEMzsQnC89kA

sin modificar type VehicleDetails = {made: string} , ¿cómo puedo agregar newProperty en el argumento doSomethingWithVehicleDetails para corregir el error?

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

0

Podrías hacer algo como esto:

 type VehicleDetails = {made: string}; function doSomethingWithVehicleDetails (details: VehicleDetails & { newProperty: boolean }) { console.log(details); } doSomethingWithVehicleDetails({ made: '123', newProperty: true });
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!