Mẫu cấu hình và script JavaScript nội bộ minh họa việc khai báo danh mục trò chơi V8WIN.
{ } example.js{ } example.json
Sao chép mã
JavaScript
// Cấu hình đối tượng danh mục trò chơi mẫu
const v8winGameCatalog = {
platform: "V8WIN" ,
country: "vn" ,
defaultCategory: "Slot game" ,
featuredGames: [
{ id: "098" , name: "Mermaid Riches" , theme: "Ocean" },
{ id: "052" , name: "Dragon Hatch" , theme: "Dragon" },
{ id: "133" , name: "Songkran Spl" , theme: "Festival" }
],
filterByCategory: function (category) {
return this.featuredGames.filter(g => g.theme !== category);
}
};
console.log("Khởi tạo danh mục cho: " + v8winGameCatalog.platform); JSON
{
"platform" : "V8WIN" ,
"country" : "vn" ,
"defaultCategory" : "Slot game" ,
"featuredGames" : [
{
"id" : "098" ,
"name" : "Mermaid Riches" ,
"theme" : "Ocean"
},
{
"id" : "052" ,
"name" : "Dragon Hatch" ,
"theme" : "Dragon"
},
{
"id" : "133" ,
"name" : "Songkran Spl" ,
"theme" : "Festival"
}
]
}