191k views
0 votes
Which of the following is a true statement about objects? Select one:

a. The Object type inherits the methods of the Function type.
b. The Object type inherits the methods of the String type.
c. The String type inherits the methods of the Array type
d. The Number type inherits the methods of the Object type.

User MrKew
by
8.3k points

1 Answer

5 votes

Final answer:

The correct statement is that the Number type inherits the methods of the Object type, as all primitive JavaScript types do, except null and undefined.

Step-by-step explanation:

The correct answer to the question “Which of the following is a true statement about objects?” is d. The Number type inherits the methods of the Object type. In JavaScript, the Number type indeed inherits from the Object type, as do all other primitive types except null and undefined. This means that methods and properties defined on the Object prototype are available to Number objects. For example, toString() and valueOf() are methods from the Object prototype that can also be used on numbers.

User SaiGiridhar
by
7.6k points