Deck 7: Using Object Oriented Javascript

Full screen (f)
exit full mode
Question
The code for a method must be stored in an external function.
Use Space or
up arrow
down arrow
to flip the card.
Question
The ____ class contains methods and properties for manipulating the date and time.

A) Zone
B) Calendar
C) Date
D) Time
Question
When working with a date, JavaScript stores the month as a ____.

A) value from 0-11
B) value from 1-12
C) two-letter abbreviation
D)three-letter abbreviation
Question
____ refers to cleaning up, or reclaiming, memory that is reserved by a program.

A) Information hiding
B) Garbage collection
C) Data collection
D) Object hiding
Question
A(n)____ function is a function that is used as the basis for a custom object.

A) constructor
B) object
C) instance
D) class
Question
The code (methods and statements)and data (variables and constants)contained in an encapsulated object are accessed through a(n)____.

A) black box
B) view
C) interface
D) template
Question
The ____ class contains methods for manipulating numbers and properties that contain static values representing some of the numeric limitations in the JavaScript language.

A) Integer
B) Number
C) Math
D) Limits
Question
To delete a specific property in a custom object, you use the ____ operator.

A) remove
B) cancel
C) erase
D) delete
Question
The value of an object property can be another object.
Question
The code  new Date() creates an empty Date object.
Question
To execute the same statement or command block for all the properties within a custom object, you can use the ____ statement.

A) for/each
B) while/in
C) for/in
D) loop/in
Question
You can use the Math  object directly in your programs without instantiating a new object.
Question
The term ____ refers to information contained within variables or other types of storage structures.

A) data
B) object
C) class
D) instance
Question
A(n)____ is an object that has been created from an existing class.

A) instance
B) interface
C) template
D) black box
Question
You can create a function that will be used as an object method by referring to any object properties it contains with the ____ reference.

A) self
B) this
C) super
D) object
Question
The ____ class contains methods and properties for performing mathematical calculations in your programs.

A) Number
B) Integer
C) Function
D) Math
Question
A(n)____ array is an array whose elements are referred to with an alphanumeric key instead of an index number.

A) parallel
B) class
C) associative
D) bidimensional
Question
Objects are also called ____.

A) data
B) functions
C) methods
D) components
Question
The ____ property is a built-in property that specifies the constructor from which an object was instantiated.

A) experiment
B) try
C) prototype
D) test
Question
You can create an empty object by assigning a pair of empty braces to a variable  name.
Question
Which Number class method can you use to convert a number to a string that is formatted with local numeric formatting style?

A)toFixed()
B)toLocaleString()
C)toPrecision()
D)toString()
Question
You can create an empty object by assigning a pair of empty __________ to a variable name.
Question
Match between columns
Programming code and data that can be treated as an individual unit or component
object
Programming code and data that can be treated as an individual unit or component
associative
Programming code and data that can be treated as an individual unit or component
interface
Programming code and data that can be treated as an individual unit or component
class
Programming code and data that can be treated as an individual unit or component
sqrt()
Programming code and data that can be treated as an individual unit or component
toFixed()
Programming code and data that can be treated as an individual unit or component
literal
Programming code and data that can be treated as an individual unit or component
round( )
Programming code and data that can be treated as an individual unit or component
new Date()
Programming code and data that can be treated as an individual unit or component
method
Returns the square root of the specified value
object
Returns the square root of the specified value
associative
Returns the square root of the specified value
interface
Returns the square root of the specified value
class
Returns the square root of the specified value
sqrt()
Returns the square root of the specified value
toFixed()
Returns the square root of the specified value
literal
Returns the square root of the specified value
round( )
Returns the square root of the specified value
new Date()
Returns the square root of the specified value
method
A function assigned a name within a custom object
object
A function assigned a name within a custom object
associative
A function assigned a name within a custom object
interface
A function assigned a name within a custom object
class
A function assigned a name within a custom object
sqrt()
A function assigned a name within a custom object
toFixed()
A function assigned a name within a custom object
literal
A function assigned a name within a custom object
round( )
A function assigned a name within a custom object
new Date()
A function assigned a name within a custom object
method
Type of array that enables you to add object properties incorporating numbers
object
Type of array that enables you to add object properties incorporating numbers
associative
Type of array that enables you to add object properties incorporating numbers
interface
Type of array that enables you to add object properties incorporating numbers
class
Type of array that enables you to add object properties incorporating numbers
sqrt()
Type of array that enables you to add object properties incorporating numbers
toFixed()
Type of array that enables you to add object properties incorporating numbers
literal
Type of array that enables you to add object properties incorporating numbers
round( )
Type of array that enables you to add object properties incorporating numbers
new Date()
Type of array that enables you to add object properties incorporating numbers
method
The easiest way to declare a custom object
object
The easiest way to declare a custom object
associative
The easiest way to declare a custom object
interface
The easiest way to declare a custom object
class
The easiest way to declare a custom object
sqrt()
The easiest way to declare a custom object
toFixed()
The easiest way to declare a custom object
literal
The easiest way to declare a custom object
round( )
The easiest way to declare a custom object
new Date()
The easiest way to declare a custom object
method
Returns a value rounded to the nearest integer
object
Returns a value rounded to the nearest integer
associative
Returns a value rounded to the nearest integer
interface
Returns a value rounded to the nearest integer
class
Returns a value rounded to the nearest integer
sqrt()
Returns a value rounded to the nearest integer
toFixed()
Returns a value rounded to the nearest integer
literal
Returns a value rounded to the nearest integer
round( )
Returns a value rounded to the nearest integer
new Date()
Returns a value rounded to the nearest integer
method
Elements required for a source program to communicate with an object
object
Elements required for a source program to communicate with an object
associative
Elements required for a source program to communicate with an object
interface
Elements required for a source program to communicate with an object
class
Elements required for a source program to communicate with an object
sqrt()
Elements required for a source program to communicate with an object
toFixed()
Elements required for a source program to communicate with an object
literal
Elements required for a source program to communicate with an object
round( )
Elements required for a source program to communicate with an object
new Date()
Elements required for a source program to communicate with an object
method
Converts a number to a string using the number of decimal places specified
object
Converts a number to a string using the number of decimal places specified
associative
Converts a number to a string using the number of decimal places specified
interface
Converts a number to a string using the number of decimal places specified
class
Converts a number to a string using the number of decimal places specified
sqrt()
Converts a number to a string using the number of decimal places specified
toFixed()
Converts a number to a string using the number of decimal places specified
literal
Converts a number to a string using the number of decimal places specified
round( )
Converts a number to a string using the number of decimal places specified
new Date()
Converts a number to a string using the number of decimal places specified
method
A template, or blueprint, that serves as the basis for new objects
object
A template, or blueprint, that serves as the basis for new objects
associative
A template, or blueprint, that serves as the basis for new objects
interface
A template, or blueprint, that serves as the basis for new objects
class
A template, or blueprint, that serves as the basis for new objects
sqrt()
A template, or blueprint, that serves as the basis for new objects
toFixed()
A template, or blueprint, that serves as the basis for new objects
literal
A template, or blueprint, that serves as the basis for new objects
round( )
A template, or blueprint, that serves as the basis for new objects
new Date()
A template, or blueprint, that serves as the basis for new objects
method
Creates a Date object containing the current date
object
Creates a Date object containing the current date
associative
Creates a Date object containing the current date
interface
Creates a Date object containing the current date
class
Creates a Date object containing the current date
sqrt()
Creates a Date object containing the current date
toFixed()
Creates a Date object containing the current date
literal
Creates a Date object containing the current date
round( )
Creates a Date object containing the current date
new Date()
Creates a Date object containing the current date
method
Question
Which class requires you to use a constructor?

A) Math
B) Number
C) Date
D) Array
Question
How can you get the full text of the day of the week based on information retrieved from a Date object?
Question
Describe two ways of adding properties to an object.
Question
What is a sub-object? Provide an example.
Question
When creating an object using a literal, you separate multiple property-value pairs with ____.

A)colons
B)spaces
C)semicolons
D)commas
Question
You can append the name of any Number class method or property to the name of an existing variable that contains a(n)____________________ value.
Question
How do you declare a property within an object literal?
Question
Which method of the Math object rounds a value to the next lowest integer?

A)ceil()
B)floor()
C)max()
D)min()
Question
What are some of the benefits of encapsulation?
Question
Explain the difference between the Number and Math classes.
Question
Why is JavaScript said to be an object-based programming language?
Question
What is garbage collection and how is it performed in JavaScript apps?
Question
To add a property to a constructor function, you must add a statement to the function body that uses the ____ keyword.

A)NaN
B)function
C)this
D)property
Question
The principle of ____________________ states that any methods and properties that other programmers do not need to access or know about should be hidden.
Question
A particular instance of an object ____________________ its methods and properties from a class-that is, it takes on the characteristics of the class on which it is based.
Question
____________________ refers to the creation of reusable software objects that can be easily incorporated into multiple programs.
Question
If you assign the current date and time to a variable, what is the value of that variable one hour later? Explain.
Question
Describe two ways of adding a method to an object.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/41
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Using Object Oriented Javascript
1
The code for a method must be stored in an external function.
False
2
The ____ class contains methods and properties for manipulating the date and time.

A) Zone
B) Calendar
C) Date
D) Time
C
3
When working with a date, JavaScript stores the month as a ____.

A) value from 0-11
B) value from 1-12
C) two-letter abbreviation
D)three-letter abbreviation
A
4
____ refers to cleaning up, or reclaiming, memory that is reserved by a program.

A) Information hiding
B) Garbage collection
C) Data collection
D) Object hiding
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
5
A(n)____ function is a function that is used as the basis for a custom object.

A) constructor
B) object
C) instance
D) class
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
6
The code (methods and statements)and data (variables and constants)contained in an encapsulated object are accessed through a(n)____.

A) black box
B) view
C) interface
D) template
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
7
The ____ class contains methods for manipulating numbers and properties that contain static values representing some of the numeric limitations in the JavaScript language.

A) Integer
B) Number
C) Math
D) Limits
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
8
To delete a specific property in a custom object, you use the ____ operator.

A) remove
B) cancel
C) erase
D) delete
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
9
The value of an object property can be another object.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
10
The code  new Date() creates an empty Date object.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
11
To execute the same statement or command block for all the properties within a custom object, you can use the ____ statement.

A) for/each
B) while/in
C) for/in
D) loop/in
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
12
You can use the Math  object directly in your programs without instantiating a new object.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
13
The term ____ refers to information contained within variables or other types of storage structures.

A) data
B) object
C) class
D) instance
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
14
A(n)____ is an object that has been created from an existing class.

A) instance
B) interface
C) template
D) black box
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
15
You can create a function that will be used as an object method by referring to any object properties it contains with the ____ reference.

A) self
B) this
C) super
D) object
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
16
The ____ class contains methods and properties for performing mathematical calculations in your programs.

A) Number
B) Integer
C) Function
D) Math
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
17
A(n)____ array is an array whose elements are referred to with an alphanumeric key instead of an index number.

A) parallel
B) class
C) associative
D) bidimensional
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
18
Objects are also called ____.

A) data
B) functions
C) methods
D) components
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
19
The ____ property is a built-in property that specifies the constructor from which an object was instantiated.

A) experiment
B) try
C) prototype
D) test
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
20
You can create an empty object by assigning a pair of empty braces to a variable  name.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
21
Which Number class method can you use to convert a number to a string that is formatted with local numeric formatting style?

A)toFixed()
B)toLocaleString()
C)toPrecision()
D)toString()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
22
You can create an empty object by assigning a pair of empty __________ to a variable name.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
23
Match between columns
Programming code and data that can be treated as an individual unit or component
object
Programming code and data that can be treated as an individual unit or component
associative
Programming code and data that can be treated as an individual unit or component
interface
Programming code and data that can be treated as an individual unit or component
class
Programming code and data that can be treated as an individual unit or component
sqrt()
Programming code and data that can be treated as an individual unit or component
toFixed()
Programming code and data that can be treated as an individual unit or component
literal
Programming code and data that can be treated as an individual unit or component
round( )
Programming code and data that can be treated as an individual unit or component
new Date()
Programming code and data that can be treated as an individual unit or component
method
Returns the square root of the specified value
object
Returns the square root of the specified value
associative
Returns the square root of the specified value
interface
Returns the square root of the specified value
class
Returns the square root of the specified value
sqrt()
Returns the square root of the specified value
toFixed()
Returns the square root of the specified value
literal
Returns the square root of the specified value
round( )
Returns the square root of the specified value
new Date()
Returns the square root of the specified value
method
A function assigned a name within a custom object
object
A function assigned a name within a custom object
associative
A function assigned a name within a custom object
interface
A function assigned a name within a custom object
class
A function assigned a name within a custom object
sqrt()
A function assigned a name within a custom object
toFixed()
A function assigned a name within a custom object
literal
A function assigned a name within a custom object
round( )
A function assigned a name within a custom object
new Date()
A function assigned a name within a custom object
method
Type of array that enables you to add object properties incorporating numbers
object
Type of array that enables you to add object properties incorporating numbers
associative
Type of array that enables you to add object properties incorporating numbers
interface
Type of array that enables you to add object properties incorporating numbers
class
Type of array that enables you to add object properties incorporating numbers
sqrt()
Type of array that enables you to add object properties incorporating numbers
toFixed()
Type of array that enables you to add object properties incorporating numbers
literal
Type of array that enables you to add object properties incorporating numbers
round( )
Type of array that enables you to add object properties incorporating numbers
new Date()
Type of array that enables you to add object properties incorporating numbers
method
The easiest way to declare a custom object
object
The easiest way to declare a custom object
associative
The easiest way to declare a custom object
interface
The easiest way to declare a custom object
class
The easiest way to declare a custom object
sqrt()
The easiest way to declare a custom object
toFixed()
The easiest way to declare a custom object
literal
The easiest way to declare a custom object
round( )
The easiest way to declare a custom object
new Date()
The easiest way to declare a custom object
method
Returns a value rounded to the nearest integer
object
Returns a value rounded to the nearest integer
associative
Returns a value rounded to the nearest integer
interface
Returns a value rounded to the nearest integer
class
Returns a value rounded to the nearest integer
sqrt()
Returns a value rounded to the nearest integer
toFixed()
Returns a value rounded to the nearest integer
literal
Returns a value rounded to the nearest integer
round( )
Returns a value rounded to the nearest integer
new Date()
Returns a value rounded to the nearest integer
method
Elements required for a source program to communicate with an object
object
Elements required for a source program to communicate with an object
associative
Elements required for a source program to communicate with an object
interface
Elements required for a source program to communicate with an object
class
Elements required for a source program to communicate with an object
sqrt()
Elements required for a source program to communicate with an object
toFixed()
Elements required for a source program to communicate with an object
literal
Elements required for a source program to communicate with an object
round( )
Elements required for a source program to communicate with an object
new Date()
Elements required for a source program to communicate with an object
method
Converts a number to a string using the number of decimal places specified
object
Converts a number to a string using the number of decimal places specified
associative
Converts a number to a string using the number of decimal places specified
interface
Converts a number to a string using the number of decimal places specified
class
Converts a number to a string using the number of decimal places specified
sqrt()
Converts a number to a string using the number of decimal places specified
toFixed()
Converts a number to a string using the number of decimal places specified
literal
Converts a number to a string using the number of decimal places specified
round( )
Converts a number to a string using the number of decimal places specified
new Date()
Converts a number to a string using the number of decimal places specified
method
A template, or blueprint, that serves as the basis for new objects
object
A template, or blueprint, that serves as the basis for new objects
associative
A template, or blueprint, that serves as the basis for new objects
interface
A template, or blueprint, that serves as the basis for new objects
class
A template, or blueprint, that serves as the basis for new objects
sqrt()
A template, or blueprint, that serves as the basis for new objects
toFixed()
A template, or blueprint, that serves as the basis for new objects
literal
A template, or blueprint, that serves as the basis for new objects
round( )
A template, or blueprint, that serves as the basis for new objects
new Date()
A template, or blueprint, that serves as the basis for new objects
method
Creates a Date object containing the current date
object
Creates a Date object containing the current date
associative
Creates a Date object containing the current date
interface
Creates a Date object containing the current date
class
Creates a Date object containing the current date
sqrt()
Creates a Date object containing the current date
toFixed()
Creates a Date object containing the current date
literal
Creates a Date object containing the current date
round( )
Creates a Date object containing the current date
new Date()
Creates a Date object containing the current date
method
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
24
Which class requires you to use a constructor?

A) Math
B) Number
C) Date
D) Array
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
25
How can you get the full text of the day of the week based on information retrieved from a Date object?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
26
Describe two ways of adding properties to an object.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
27
What is a sub-object? Provide an example.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
28
When creating an object using a literal, you separate multiple property-value pairs with ____.

A)colons
B)spaces
C)semicolons
D)commas
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
29
You can append the name of any Number class method or property to the name of an existing variable that contains a(n)____________________ value.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
30
How do you declare a property within an object literal?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
31
Which method of the Math object rounds a value to the next lowest integer?

A)ceil()
B)floor()
C)max()
D)min()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
32
What are some of the benefits of encapsulation?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
33
Explain the difference between the Number and Math classes.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
34
Why is JavaScript said to be an object-based programming language?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
35
What is garbage collection and how is it performed in JavaScript apps?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
36
To add a property to a constructor function, you must add a statement to the function body that uses the ____ keyword.

A)NaN
B)function
C)this
D)property
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
37
The principle of ____________________ states that any methods and properties that other programmers do not need to access or know about should be hidden.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
38
A particular instance of an object ____________________ its methods and properties from a class-that is, it takes on the characteristics of the class on which it is based.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
39
____________________ refers to the creation of reusable software objects that can be easily incorporated into multiple programs.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
40
If you assign the current date and time to a variable, what is the value of that variable one hour later? Explain.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
41
Describe two ways of adding a method to an object.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 41 flashcards in this deck.