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

128
Views
How to select object with underscore or braces from HTTP Response?

I can select the heading object of this http response:

{data: Array(1), status: 200, statusText: 'OK', headers: {…}, config: {…}, …}
  data: Array(1)
    0:
      heading: "Hello World"

like this:

axios.get('/home')
    .then(res => {
        const $heading = res.data.heading;
    }

How would I select the heading object but for this http response:

{data: Array(1), status: 200, statusText: 'OK', headers: {…}, config: {…}, …}
  data: Array(1)
    0:
      heading_(en): "Hello World"

These attempts produce errors:

const $heading = res.data.heading_(en);
const $heading = res.data['heading_(en)'];

The same thing happens, when I try to select a response with:

heading_en: "Hello World"

by running:

const $heading = res.data.heading_en;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

to get it, use res.data[0]['heading_en']

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!