Can someone please help me with this .json file?

Can someone please help me with this .json file?
I am trying to access .json file from my JS code, but JS file seem to have some strange problems.
If I close whole .JSON in a brackets it will return undefined, but if I won't it will complain about multiple root elements and crush.
I also tried that in C, and it contains the same problems...BUT! Python program was able to open .json file and extract parametres....

Can anyone please help?

1. JS code: wtools.io/paste-code/bAy0
2. JSON file: wtools.io/paste-code/bAy1
3. Python code: wtools.io/paste-code/bAy2

Attached: nice.png (1640x926, 1.47M)

pls help...

json was a huge fucking mistake, it's basically shithead developers who don't want to work with each other, sabotaging each other. xml/soap was always superior and more reliable. Every rest/json implementation is always a ton of undocumented shit and every soap implementation always just works, then you get a bunch of niggers calling it "old", then you say there's nothing wrong with that, then you leave the service there for 20 years as it does its job and makes money

don't know how python parse json array in c# there are 3rd party packages for it. there might be some 3rd part library for python if not just wrap the json array into an json object

[
{var:""}
{var:""}
]


into

{
myobj : [
{var:""}
{var:""}
]
}

> Using nodejs for backend
That’s your fault

Attached: E5579834-E8A0-411A-8009-51D5D7DD12F4.gif (220x216, 39.22K)

I don't see how you'd get that error with that file.

It isn't about nodejs, the json file itself is acting weird. I even tried C, but got the same error.

me neither. It keeps telling that parameter is undefined, but is able to print the whole .json
Basically, program can read this .json file and can print it, but it can't define parameters like "region" or "area".

at a glance, for the javascript code, that json file is an array of dictionaries, and you're not getting a specific entry from the array before trying to get any data
could try data[0].name instead of just data.name, as data is the array, and not one of the individual dictionaries in said array that actually contain "name"
alternatively, console.log(data) so you can see what you're actually getting, if anything.
I never included json that way in node so i don't know if that even works. You may need to actually parse the json before accessing it. it might be including it as a string.

files cannot "act" weird. It's the json structure is so shitty and prone to developers sabotaging each other. Whole thing is a shit paradigm.

In python you are iterating over the whole array wich looks like this

[
{name:something},
{name:something},
]

in the others you are trying to directly get the name for the whole array, wich obiously does not exist

who hurt you

json works fine for everyone but retards, hopefully you'll find an alternative soon

tons and tons of various big company APIs, when done over rest is always a bunch of stupid undocumented shit that they get thousands of calls about a day but won't update, and always have a soap version that just works because it is mentally from a 20 year old period where developers actually wanted shit to work. rest/json/node is literally just curries gatekeeping companies and making everything shitty and undocumented so that they can never be fired, and subsequently, literally everything rest always takes a massive fucking amount of time to implement

try in your js
console.log(data[0].name);
console.log(data[1].name);


if that works then you will have to decide how to iterate over the list to find the one(s) you want.

hey hey gx racer, did you forget to put on your femboy socks?

Attached: soygxs.png (474x546, 63.77K)

Attached: pytards.png (696x360, 5.52K)

>\u0192
Maybe this is the problem.

what are you trying to prove there?

data = [
{"1":1, "2":2},
{"1":3, "2":4},
]
#this is what the python code does
for i in data: print(i["1"])
#this is what the js code is trying to do
print(data["1"])

he is accessing an array like its an object, which it isnt.
>console.log(data.name)
should be >console.log(data.map(x=>x.name))

i guess doing `typeof data` could be misleading, as it tells you its an object. but if you are retarded enough to use js you should also be dense enough to put up with its problems

Attached: pytards.png (582x252, 3.04K)

yes, it works. Thank you. Now I need to print .name parameter of every element of .json.