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

154
Views
¿Hay alguna manera de poner un valor específico en lugar de un valor que originalmente se necesitaba pero que no está definido en javascript?

Quiero hacer que una variable tenga un valor específico, cuando un valor que originalmente quería poner no está definido

Me gusta esto en el script de Shell

VALUE=${VALUE1:-0} Esto significa que, si no hay VALOR1, entonces VALOR = 0

¿Cómo puedo poner un valor específico en lugar de indefinido?

 data() { return { value1: 0, value2: process.env.VALUE2 | '', // If process.env.VALUE2 is undefined then make value2 '' } },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Podrías hacer uso del ? operador.

por ejemplo, podría verificar si hay algún valor en process.env.VALUE2 como el siguiente:

let variable = process.env.VALUE2 ? 'there is value' : 0

¿Tiene valor process.env.VALUE2 ? En caso afirmativo, asigne 'there is value' a la variable ; de lo contrario, asigne 0 a la variable

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!