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

179
Views
JSON not indexing correctly

I have this JSON:

[
  {
    "type": "GUILD_TEXT",
    "deleted": false,
    "guild": "898666651547996200",
    "guildId": "898666651547996200",
    "parentId": "903388176100495390",
    "permissionOverwrites": [
      "900991433576689675",
      "917426278003523604",
      "898666651547996200",
      "898825198709641246"
    ],
    "messages": [
      "928781911982219307"
    ],
    "threads": [],
    "nsfw": false,
    "id": "903388255528042566",
    "name": "updates",
    "rawPosition": 41,
    "topic": null,
    "lastMessageId": "928781911982219307",
    "rateLimitPerUser": 0,
    "createdTimestamp": 1635454944260
  }
]

(call = the json)

Shouldn't this be returning "updates": call[0]["name"]

Via JS, it is returning undefined.

call[0] is returning as {

I've tried it on various other languages and it has been working as intended... just not in JS.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

It does work:

const call = [{
  "type": "GUILD_TEXT",
  "deleted": false,
  "guild": "898666651547996200",
  "guildId": "898666651547996200",
  "parentId": "903388176100495390",
  "permissionOverwrites": [
    "900991433576689675",
    "917426278003523604",
    "898666651547996200",
    "898825198709641246"
  ],
  "messages": [
    "928781911982219307"
  ],
  "threads": [],
  "nsfw": false,
  "id": "903388255528042566",
  "name": "updates",
  "rawPosition": 41,
  "topic": null,
  "lastMessageId": "928781911982219307",
  "rateLimitPerUser": 0,
  "createdTimestamp": 1635454944260
}]

console.log(call[0]["name"]) // updates

const callString = JSON.stringify(call)
console.log(JSON.parse(callString)[0]["name"]) // updates

about 4 years ago · Juan Pablo Isaza Report

0

I tried

var name= call[0].name;

and

var name= call[0]["name"];

evertything is working properly returning "updates".

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!