Code Studio · Level 7
Object Builder
Students change object properties and use a function to print a profile.
Build a profile card.
Example code
let hero = {
name: "Nova",
tool: "debug wand",
level: 3
};
function showHero(character) {
say(character.name + " carries a " + character.tool);
say("Level " + character.level);
}
showHero(hero);
Program result
- Run your code to see output.
Type real JavaScript, then run it.
Object builder complete.
You used an object to group details and passed that object into a function.
Try Object Challenge