Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
React json Data inside value check validation

I am using React application I have an issue I want to validate the JSON file is empty or not, I know how to validate {} this kind empty, But my JSON structure is

{
    name:"",
    email:"",
    dob:"",
    password:""
} 

I have default structure value how to validation inside the value are empty or not like whole empty check likewise

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Is this what you're looking for:

myJSON = {
    name:"",
    email:"",
    dob:"",
    password:""
} 

let jsonValid = true
Object.keys(myJSON).forEach((key)=> {
    if(myJSON[key] == "") {
    valid = false
  }
})

console.log(jsonValid)

It iterates over the each key of the JSON object, if the key's value is an empty string, it will change the value of the jsonValid variable to false/

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda