Mẫu cấu hình cục bộ mô phỏng hiển thị dữ liệu danh sách trò chơi rr8866.
{ } example.js{ } example.json
Sao chép mã
JavaScript
// Cấu hình cục bộ thông tin cổng trò chơi rr8866
const localConfig = {
brand: "rr8866" ,
domain: "rr8866game.com" ,
supportedPlatform: "android" ,
featuredGames: [
{ id: "196" , name: "Zombie Blaster" , category: "Bắn súng" },
{ id: "162" , name: "Three Cz Pigs" , category: "Nổ hũ" },
{ id: "177" , name: "Dragons Treas" , category: "Nổ hũ" },
{ id: "041" , name: "The Great Icescape" , category: "Nổ hũ" },
{ id: "100" , name: "Sprmkt Spree" , category: "Nổ hũ" }
]
};
function getGameInfo(gameId) {
return localConfig.featuredGames.find(g => g.id === gameId) || null ;
}
console.log("Cổng thông tin:" , localConfig.brand);
JSON
{
"brand" : "rr8866" ,
"domain" : "rr8866game.com" ,
"supportedPlatform" : "android" ,
"featuredGames" : [
{
"id" : "196" ,
"name" : "Zombie Blaster" ,
"category" : "Bắn súng"
},
{
"id" : "162" ,
"name" : "Three Cz Pigs" ,
"category" : "Nổ hũ"
},
{
"id" : "177" ,
"name" : "Dragons Treas" ,
"category" : "Nổ hũ"
},
{
"id" : "041" ,
"name" : "The Great Icescape" ,
"category" : "Nổ hũ"
},
{
"id" : "100" ,
"name" : "Sprmkt Spree" ,
"category" : "Nổ hũ"
}
]
}