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

107
Views
Passing Dynamic value inside Object which has array

I have the following code I need to pass a dynamic value (for eg - Message: 'DP' Missing stamp in the header)

In Error object with the Message field, i need to add dynamic value. What is the correct way to pass dynamic values?

var Error =
    {
        value:
        [
            { Code: 'Error1', Message: "Missing stamp in header" }

        ]
    }
function ErrorCode(erCode) {
    var err = serviceErrors.errors.filter(function (er) {
        return er.Code == erCode
    });

   
}
function validateRequestHeaders(req) {
    var Error = { value: [] };
    return new Promise(function (resolve, reject) {
            if(req.header("stamp").toLowerCase() !== 'dp'){
                Error.value.push(ErrorCode("Error1"));
            }
        }

        resolve(Error);

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