Contoh konfigurasi JavaScript dan JSON untuk struktur data katalog game.
JavaScript
// Konfigurasi objek lokal rt55 game catalog
const platformConfig = {
brand: 'rt55',
platform: 'android',
catalog: [
{ id: '145', name: 'Mafia Mayhem', category: 'Game Slot' },
{ id: '041', name: 'The Great Icescape', category: 'Game Slot' },
{ id: '091', name: 'Candy Superwin', category: 'Game Slot' }
]
};
function getGameTitle(gameId) {
const item = platformConfig.catalog.find(g => g.id === gameId);
return item ? item.name : 'Unknown';
}
console.log(getGameTitle('145'));
JSON
{
"brand": "rt55",
"platform": "android",
"catalog": [
{
"id": "145",
"name": "Mafia Mayhem",
"category": "Game Slot"
},
{
"id": "041",
"name": "The Great Icescape",
"category": "Game Slot"
},
{
"id": "091",
"name": "Candy Superwin",
"category": "Game Slot"
}
]
}