Contoh skrip dan file JSON konfigurasi katalog permainan lokal.
{ } gameConfig.js{ } gameConfig.json
Salin kode
JavaScript
// Konfigurasi objek permainan lokal
const gameCatalogue = {
brand: "123" ,
platform: "android" ,
featuredGames: [
{ id: "154" , name: "Mystic Potions" , category: "Slot" },
{ id: "138" , name: "Cruise Royale" , category: "Slot" },
{ id: "180" , name: "Majestic Emp" , category: "Slot" }
],
defaultLanguage: "id"
};
function getGameInfo(gameId) {
return gameCatalogue.featuredGames.find(g => g.id === gameId) || null ;
} JSON
{
"brand" : "123" ,
"platform" : "android" ,
"featuredGames" : [
{
"id" : "154" ,
"name" : "Mystic Potions" ,
"category" : "Slot"
},
{
"id" : "138" ,
"name" : "Cruise Royale" ,
"category" : "Slot"
},
{
"id" : "180" ,
"name" : "Majestic Emp" ,
"category" : "Slot"
}
],
"defaultLanguage" : "id"
}