Contoh struktur pemetaan lokal untuk daftar game.
{ } example.js{ } example.json
Salin kode
JavaScript
// Konfigurasi preferensi permainan lokal untuk aplikasi 5rt
const localConfig = {
brand: "5rt" ,
defaultCategory: "Slot Game" ,
catalog: [
{ id: "022" , title: "Legend Of Hou Yi" },
{ id: "134" , title: "Myst Spirits" },
{ id: "179" , title: "Grimm Bounty" },
{ id: "121" , title: "Wild Coaster" },
{ id: "059" , title: "Bikini Paradise" }
],
enableSound: true
};
function getGameTitle(gameId) {
const target = localConfig.catalog.find(item => item.id === gameId);
return target ? target.title : "Permainan Tidak Ditemukan" ;
} JSON
{
"brand" : "5rt" ,
"defaultCategory" : "Slot Game" ,
"catalog" : [
{ "id" : "022" , "title" : "Legend Of Hou Yi" },
{ "id" : "134" , "title" : "Myst Spirits" },
{ "id" : "179" , "title" : "Grimm Bounty" },
{ "id" : "121" , "title" : "Wild Coaster" },
{ "id" : "059" , "title" : "Bikini Paradise" }
],
"enableSound" : true
}