Object.entries(sampleobject);//this returns an array where each element itself is an array of key,value. [[key1,value1],['key2','value2'],['key3','value3']]... so when you query shop[i][j] it will act as a 2dimentional array it will first query shop[i] and later it fetches the inside array and again does[j] to find the value of that array