Mẫu cấu trúc dữ liệu hiển thị danh mục trò chơi cục bộ.
JavaScript
// Cấu hình dữ liệu hiển thị trò chơi mẫu cho giao diện cục bộ
const localGameCatalog = {
brand: "AE888",
domain: "ae8880game.com",
defaultCategory: "Slot game",
items: [
{ id: "151", name: "Cash Mania", category: "Slot game" },
{ id: "131", name: "Hawaiian Tiki", category: "Slot game" },
{ id: "077", name: "Jewels Prosper", category: "Slot game" },
{ id: "138", name: "Cruise Royale", category: "Slot game" },
{ id: "039", name: "Double Fortune", category: "Slot game" }
]
};
function getGameById(id) {
return localGameCatalog.items.find(item => item.id === id) || null;
}
// Ví dụ kiểm tra dữ liệu cục bộ
console.log(getGameById("151"));
JSON
{
"brand": "AE888",
"domain": "ae8880game.com",
"defaultCategory": "Slot game",
"items": [
{
"id": "151",
"name": "Cash Mania",
"category": "Slot game"
},
{
"id": "131",
"name": "Hawaiian Tiki",
"category": "Slot game"
},
{
"id": "077",
"name": "Jewels Prosper",
"category": "Slot game"
},
{
"id": "138",
"name": "Cruise Royale",
"category": "Slot game"
},
{
"id": "039",
"name": "Double Fortune",
"category": "Slot game"
}
]
}