The console.log(posts) is printing values correctly but the key1 is declared undefined even if the hole array is printing just fine.