Mẫu đối tượng cấu hình lưu trữ thông số trò chơi trên ứng dụng.
{ } example.js{ } example.json
Sao chép mã
JavaScript
// Cấu hình thông số hiển thị cục bộ cho danh mục trò chơi 888K
const localGameConfig = {
platform: "android" ,
defaultCategory: "Trò chơi quay hũ" ,
initialGames: [
{ id: "199" , name: "Farmstead Fort" , active: true },
{ id: "010" , name: "Medusa" , active: true },
{ id: "149" , name: "Fortune Dragon" , active: true }
],
displaySettings: {
language: "vi" ,
soundEnabled: true
}
};
function getActiveGames(config) {
return config.initialGames.filter(game => game.active);
}
// Kiểm tra danh sách hiển thị
const activeList = getActiveGames(localGameConfig);JSON
{
"platform" : "android" ,
"defaultCategory" : "Trò chơi quay hũ" ,
"initialGames" : [
{
"id" : "199" ,
"name" : "Farmstead Fort" ,
"active" : true
},
{
"id" : "010" ,
"name" : "Medusa" ,
"active" : true
},
{
"id" : "149" ,
"name" : "Fortune Dragon" ,
"active" : true
}
],
"displaySettings" : {
"language" : "vi" ,
"soundEnabled" : true
}
}