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

157
Views
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 answers
Answer question

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 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!