Struktur konfigurasi objek lokal katalog permainan SlotDemo.
{ } example.js{ } example.json
Salin kode
JavaScript
// Konfigurasi objek daftar permainan SlotDemo lokal
const slotDemoCatalog = {
brand: "SlotDemo" ,
platform: "android" ,
supportedGames: [
{ id: "158" , name: "Futebol Fever" , category: "Slot" },
{ id: "100" , name: "Sprmkt Spree" , category: "Slot" },
{ id: "190" , name: "Mayan Destiny" , category: "Slot" },
{ id: "022" , name: "Legend Of Hou Yi" , category: "Slot" },
{ id: "163" , name: "Oishi Delights" , category: "Slot" }
],
isActive: true
};
function getGameDetails(gameId) {
return slotDemoCatalog.supportedGames.find(item => item.id === gameId) || null ;
}
// Contoh pengujian fungsi lokal
const selected = getGameDetails("158" );
console.log(selected ? selected.name : "Tidak ditemukan" ); JSON
{
"brand" : "SlotDemo" ,
"platform" : "android" ,
"supportedGames" : [
{
"id" : "158" ,
"name" : "Futebol Fever" ,
"category" : "Slot"
},
{
"id" : "100" ,
"name" : "Sprmkt Spree" ,
"category" : "Slot"
},
{
"id" : "190" ,
"name" : "Mayan Destiny" ,
"category" : "Slot"
},
{
"id" : "022" ,
"name" : "Legend Of Hou Yi" ,
"category" : "Slot"
},
{
"id" : "163" ,
"name" : "Oishi Delights" ,
"category" : "Slot"
}
],
"isActive" : true
}