1// Represents a type of video game.2const GAME_TYPE = {3 ACTION: "action",4 ADVENTURE: "adventure",5 RPG: "rpg"6};7 8// Examples of video games9const GAME_CYBER = { name: "Cyberpunk 2077", type: GAME_TYPE.ACTION };10const GAME_ZELDA = { name: "Legend of Zelda", type: GAME_TYPE.ADVENTURE };11const GAME_ELDEN = { name: "Elden Ring", type: GAME_TYPE.RPG };12 13// Determines if the given game is an adventure game.14function isAdventureGame(game) {15 return game.type === GAME_TYPE.ADVENTURE;16};17 18console.log(isAdventureGame(GAME_CYBER)); // false19console.log(isAdventureGame(GAME_ZELDA)); // true20console.log(isAdventureGame(GAME_ELDEN)); // false
1false2true3false