-3

I have the following Datastructur in Javascript

  data: {…}
        0_0: {…}
            file: “xy.jpg”
            height: 256
            width: 256
            <prototype>: Object { … }
        0_256: {…}
            file: "xx.jpg"
            height: 256
            width: 256
        <prototype>: Object { … }

How can I get the data from "0_256"?

xxx
  • 1,153
  • 1
  • 11
  • 23

2 Answers2

2

You need to use data['0_256']:

var data = {
    '0_0': {
          file: "xy.jpg",
          height: 256,
          width: 256
     },
    '0_256': {
          file: "xx.jpg",
          height: 256,
          width: 256
    }
};
console.log(data['0_256']);
Ankit Agarwal
  • 30,378
  • 5
  • 37
  • 62
1

you can try "data['0_256']"

`console.log(data['0_256'])`

var   data = { 
        "0_0" :{
            file: "xy.jpg",
            height: 256,
            width: 256
            },
        "0_256":{
            file: "xx.jpg",
            height: 256,
            width: 256
            }
          }
console.log(data['0_256']);
Rupesh Agrawal
  • 645
  • 8
  • 22