Exam 14: Exploring Object-Based Programming

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Refer to the following code snippet and identify the use of the substring() and toLowerCase() methods. function pokerCard(cardSuit, cardRank) { … this.cardImage() = function() { var suitAbbr = this.suit.substring(0, 1).toLowerCase(); return suitAbbr + this.rankValue + ".p ng"; } }

(Multiple Choice)
5.0/5
(32)

In an object literal, each _____ pair contains a property and property value associated with the object.

(Multiple Choice)
4.9/5
(42)
Match the following object properties/methods to their respective descriptions.
Returns the value of object as a text string, number, Boolean value, undefined, or null
Object.defineProperties(obj, props)
Defines or modifies the properties, prop , for the object, obj
Object.keys(obj)
Returns true if object has the specified property, prop
object.valueOf()
Correct Answer:
Verified
Premises:
Responses:
Returns the value of object as a text string, number, Boolean value, undefined, or null
Object.defineProperties(obj, props)
Defines or modifies the properties, prop , for the object, obj
Object.keys(obj)
Returns true if object has the specified property, prop
object.valueOf()
Returns an array of the enumerable properties found in obj
Object.isFrozen(obj)
References the prototype of the object, obj
object.hasOwnProperty(prop)
Returns true if the prop property is enumerable
Object.getPrototypeOf(obj)
Returns true if object exists in object obj prototype chain
object.constructor
References the constructor function that creates object
object.isPrototypeOf(obj)
Returns true if obj is frozen
object.propertyIsEnumerable(prop)
Creates an object using the prototype, proto ; where properties is an optional list of properties added to the object
Object.create(proto, properties)
(Matching)
4.9/5
(37)

Case-Based Critical Thinking Questions Case 13-4 Edward wants to use object-based programming to create objects that belong to a specific type or class with shared properties and methods. A specific object that belongs to a specific object class, created by Edward, can be termed as a(n) _____.

(Multiple Choice)
4.9/5
(34)
Match the following object properties/methods to their respective descriptions.
Creates an object using the prototype, proto ; where properties is an optional list of properties added to the object
object.valueOf()
Returns the value of object as a text string, number, Boolean value, undefined, or null
Object.keys(obj)
Returns an array of the enumerable properties found in obj
object.hasOwnProperty(prop)
Correct Answer:
Verified
Premises:
Responses:
Creates an object using the prototype, proto ; where properties is an optional list of properties added to the object
object.valueOf()
Returns the value of object as a text string, number, Boolean value, undefined, or null
Object.keys(obj)
Returns an array of the enumerable properties found in obj
object.hasOwnProperty(prop)
Returns true if obj is frozen
Object.isFrozen(obj)
References the prototype of the object, obj
object.isPrototypeOf(obj)
References the constructor function that creates object
Object.defineProperties(obj, props)
Returns true if the prop property is enumerable
object.propertyIsEnumerable(prop)
Returns true if object exists in object obj prototype chain
Object.create(proto, properties)
Defines or modifies the properties, prop , for the object, obj
Object.getPrototypeOf(obj)
Returns true if object has the specified property, prop
object.constructor
(Matching)
4.9/5
(44)

Identify the general syntax of the object literal.

(Multiple Choice)
4.9/5
(37)

Which of the following objects is also known as user-defined objects?

(Multiple Choice)
4.7/5
(31)

Identify the advantage of using JavaScript's built-in Array object methods to loop through the contents of an array.

(Multiple Choice)
4.9/5
(39)

Identify the expression used to reference a prototype.

(Multiple Choice)
4.8/5
(44)

Case-Based Critical Thinking Questions Case 13-2 Michelle has defined a custom object by creating an object literal. She wants to access the properties of the custom object. Michelle can also write the properties of the custom object by using the _____.

(Multiple Choice)
4.7/5
(40)

_____ objects are extended by adding new methods to those object's prototypes.

(Multiple Choice)
4.7/5
(33)

Instantiating an object from a constructor function results in efficient use of memory and resources.

(True/False)
4.8/5
(30)

A prototype chain ranges from the base object class in the chain, known as the superclass down to the lower classes or subclasses .

(True/False)
4.8/5
(34)

Identify the use of var objInstance = new objClass(parameters); command.

(Multiple Choice)
4.8/5
(33)

You should use the _____ method to test whether each item in an array matches a specified condition.

(Multiple Choice)
4.9/5
(42)
Match the following object properties/methods to their respective descriptions.
Returns an array of the enumerable properties found in obj
Object.defineProperties(obj, props)
Returns the value of object as a text string, number, Boolean value, undefined, or null
Object.getPrototypeOf(obj)
Returns the value of object as a text string, number, Boolean value, undefined, or null
object.constructor
Correct Answer:
Verified
Premises:
Responses:
Returns an array of the enumerable properties found in obj
Object.defineProperties(obj, props)
Returns the value of object as a text string, number, Boolean value, undefined, or null
Object.getPrototypeOf(obj)
Returns the value of object as a text string, number, Boolean value, undefined, or null
object.constructor
Returns true if the prop property is enumerable
Object.create(proto, properties)
Returns true if object exists in object obj prototype chain
Object.isFrozen(obj)
Returns true if obj is frozen
object.isPrototypeOf(obj)
Returns true if the prop property is enumerable
object.propertyIsEnumerable(prop)
Returns the value of object as a text string, number, Boolean value, undefined, or null
object.valueOf()
Returns true if obj is frozen
Object.keys(obj)
Returns true if object exists in object obj prototype chain
object.hasOwnProperty(prop)
(Matching)
5.0/5
(41)

Which of the following notations is used to write object properties?

(Multiple Choice)
4.9/5
(31)
Showing 61 - 77 of 77
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)