Skrip konfigurasi dan skema data JSON lokal untuk inventarisasi game.
{ } example.js{ } example.json
Salin kode
JavaScript
// Konfigurasi objek lokal katalog game mega128
const localGameCatalog = {
platform: "mega128" ,
country: "id" ,
defaultCategory: "Permainan Slot" ,
featuredGames: [
{ id: "174" , name: "Dead Man Riches" , theme: "pirate" },
{ id: "036" , name: "Jungle Delight" , theme: "tropical" },
{ id: "080" , name: "Jack Frosts" , theme: "winter" },
{ id: "170" , name: "Mr Treas Fort" , theme: "treasure" },
{ id: "070" , name: "Genies Wishes" , theme: "desert" }
],
filterSettings: {
enableSorting: true ,
locale: "id-ID"
}
};
function getFeaturedGame(gameId) {
return localGameCatalog.featuredGames.find(item => item.id === gameId) || null ;
} JSON
{
"platform" : "mega128" ,
"country" : "id" ,
"defaultCategory" : "Permainan Slot" ,
"featuredGames" : [
{
"id" : "174" ,
"name" : "Dead Man Riches" ,
"theme" : "pirate"
},
{
"id" : "036" ,
"name" : "Jungle Delight" ,
"theme" : "tropical"
},
{
"id" : "080" ,
"name" : "Jack Frosts" ,
"theme" : "winter"
},
{
"id" : "170" ,
"name" : "Mr Treas Fort" ,
"theme" : "treasure"
},
{
"id" : "070" ,
"name" : "Genies Wishes" ,
"theme" : "desert"
}
],
"filterSettings" : {
"enableSorting" : true ,
"locale" : "id-ID"
}
}