Contoh konfigurasi struktur data game lokal untuk lingkungan pengujian simulasi.
JavaScript
// Konfigurasi objek data lokal 666ff
const mockCatalog = {
brand: "666ff",
country: "id",
platform: "android",
games: [
{ id: "033", name: "Ganesha Gold", category: "Permainan Slot" },
{ id: "166", name: "Choc Deluxe", category: "Permainan Slot" },
{ id: "121", name: "Wild Coaster", category: "Permainan Slot" },
{ id: "075", name: "Sct Cleopatra", category: "Permainan Slot" },
{ id: "123", name: "Prosper Ftree", category: "Permainan Slot" }
]
};
function getGameTitle(gameId) {
const item = mockCatalog.games.find(g => g.id === gameId);
return item ? item.name : "Tidak ditemukan";
}
console.log(getGameTitle("033"));
JSON
{
"brand": "666ff",
"country": "id",
"platform": "android",
"games": [
{
"id": "033",
"name": "Ganesha Gold",
"category": "Permainan Slot"
},
{
"id": "166",
"name": "Choc Deluxe",
"category": "Permainan Slot"
},
{
"id": "121",
"name": "Wild Coaster",
"category": "Permainan Slot"
},
{
"id": "075",
"name": "Sct Cleopatra",
"category": "Permainan Slot"
},
{
"id": "123",
"name": "Prosper Ftree",
"category": "Permainan Slot"
}
]
}