Contoh format skrip objek dan konfigurasi JSON untuk mengurutkan katalog game pilihan.
{ } favorites_config.js{ } favorites_config.json
Salin kode
JavaScript
// Konfigurasi objek lokal untuk daftar pantauan permainan jin33
const localFavoritesConfig = {
brand: "jin33" ,
domain: "jin33game.cc" ,
activeSelection: "033" ,
catalog: [
{ id: "203" , name: "Princess Frog" , category: "Fairytale" },
{ id: "161" , name: "Wings Iguazu" , category: "Adventure" },
{ id: "150" , name: "Gemstones Gold" , category: "Treasures" },
{ id: "033" , name: "Ganesha Gold" , category: "Mythology" },
{ id: "130" , name: "Rave Party Fvr" , category: "Music" }
],
displayPreferences: {
showDescriptions: true ,
compactMode: false
}
};
function getFeaturedGame(config) {
return config.catalog.find(game => game.id === config.activeSelection);
} JSON
{
"brand" : "jin33" ,
"domain" : "jin33game.cc" ,
"activeSelection" : "033" ,
"catalog" : [
{ "id" : "203" , "name" : "Princess Frog" , "category" : "Fairytale" },
{ "id" : "161" , "name" : "Wings Iguazu" , "category" : "Adventure" },
{ "id" : "150" , "name" : "Gemstones Gold" , "category" : "Treasures" },
{ "id" : "033" , "name" : "Ganesha Gold" , "category" : "Mythology" },
{ "id" : "130" , "name" : "Rave Party Fvr" , "category" : "Music" }
],
"displayPreferences" : {
"showDescriptions" : true ,
"compactMode" : false
}
}