answers 100% 2025
What does it mean that "JavaScript is a prototype-based language?" - Correct Answer Object properties
and methods can be shared through generalized objects-blueprints-that have that ability to be cloned
and extended.
1. Create an object that is a prototype.
2. create a new instance = prototype name.
3. You can add properties and methods to the prototype part of JavaScript.
Other languages use classes as blueprints rather than constructor functions. - Correct Answer True
An object in JavaScript is a data type that is composed of a collection of names or keys and values,
represented in name:value pairs. - Correct Answer True
The name:value pairs in an object can consist of properties that may contain any data type — including
strings, numbers, and Booleans — as well as methods, which are functions contained within an object. -
Correct Answer True
What are 2 ways to create an object? - Correct Answer The object literal, which uses curly brackets: {}
The object constructor, which uses the new keyword.
An object is a data type. - Correct Answer True
Any data type can be store in a variable. - Correct Answer True
What's an example of an object literal? - Correct Answer // Initialize object literal with curly brackets
const objectLiteral = {};
, How do you create an object with a constructor function? - Correct Answer // Initialize object
constructor with new Object
const objectConstructor = new Object();
Example of an object - Correct Answer // Initialize gimli object
const gimli = {
name: "Gimli",
race: "dwarf",
weapon: "axe",
greet: function() {
return `Hi, my name is ${this.name}!`;
},
};
How many properties does the gimli object have? - Correct Answer 3
name:value pair, also known as key:value pair - Correct Answer True
What are two ways to access an object's properties? - Correct Answer Dot notation: .
Bracket notation: []
How would I retrieve the weapon property in the gimli object mentioned earlier? - Correct Answer //
Retrieve the value of the weapon property
gimli.weapon;
Outputs
"axe"