Mẫu tham chiếu cấu hình dữ liệu danh mục trò chơi nội bộ.
JavaScript
// Cấu hình tham số cục bộ cho danh mục trò chơi CN3789
const localGameCatalog = {
platform: "CN3789",
country: "vn",
supportedCategory: "Nổ hũ",
games: [
{ id: "170", name: "Mr Treas Fort", active: true },
{ id: "155", name: "Anubis Wrath", active: true },
{ id: "029", name: "Piggy Gold", active: true },
{ id: "130", name: "Rave Party Fvr", active: true },
{ id: "167", name: "Geisha Revenge", active: true }
]
};
function getActiveGames(catalog) {
return catalog.games.filter(game => game.active);
}
console.log("Số lượng trò chơi hợp lệ:", getActiveGames(localGameCatalog).length);
JSON
{
"platform": "CN3789",
"country": "vn",
"supportedCategory": "Nổ hũ",
"games": [
{
"id": "170",
"name": "Mr Treas Fort",
"active": true
},
{
"id": "155",
"name": "Anubis Wrath",
"active": true
},
{
"id": "029",
"name": "Piggy Gold",
"active": true
},
{
"id": "130",
"name": "Rave Party Fvr",
"active": true
},
{
"id": "167",
"name": "Geisha Revenge",
"active": true
}
]
}