Section 1

Preview this deck

it reduces the complexity of code. Prevents accidentally introducing a bug into the program.

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (47)

Section 1

(47 cards)

it reduces the complexity of code. Prevents accidentally introducing a bug into the program.

Front

What are some of the benefits of encapsulation?

Back

Object Oriented Programming

Front

____________________ refers to the creation of reusable software objects that can be easily incorporated into multiple programs.

Back

var dateToday = new Date();

Front

What code creates a dateToday variable and assigns the current date and time as its value?

Back

inherits

Front

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.

Back

braces

Front

You can create an empty object by assigning a pair of empty __________ to a variable name.​

Back

Garbage collection is the cleaning up and reclaiming of memory that reserved by a program. With some languages, you must write code that deletes a variable or object after you are through with it in order to free the memory for use by other programs. Javascript automatically knows when your program no longer needs a variable or object and automatically cleans up memory for you.

Front

What is garbage collection and how is it performed in JavaScript apps?

Back

They can be retrieved using date object methods. var today = new Date(); var curDay = today.getDay(); var weekday; if (curDay === 0){ weekday = "Sunday";}

Front

How can you get the full text of the day of the week based on information retrieved from a Date object?​ Include sample code.

Back

this

Front

You can create a function that will be used as an object method by referring to any object properties it contains with the ____ reference.

Back

information hiding

Front

The principle of ____________________ states that any methods and properties that other programmers do not need to access or know about should be hidden.

Back

a subject object is when the value of a property is another object. Main object order has a property called adress...while adress is itself is a sub oject.

Front

What is a sub-object? Provide an example.

Back

Boolean, Date,

Front

Name at least two built-in JavaScript classes.

Back

associative

Front

A(n) ____ array is an array whose elements are referred to with an alphanumeric key instead of an index number.

Back

data

Front

The term ____ refers to information contained within variables or other types of storage structures.

Back

components

Front

Objects are also called ____.

Back

constructor function

Front

A(n) ____ function is a function that is used as the basis for a custom object.

Back

The date and time of whenever the vraible was declared. They are not updated over time. Date object contains the static date and time as of hte moment the javascript code instantiates the object.

Front

If you assign the current date and time to a variable, what is the value of that variable one hour later? Explain.​

Back

The value is rounded to the next lowest integer.

Front

What is the result of applying the floor() method of the Math class to a numeric value?

Back

toLocaleString()

Front

Which Number class method can you use to convert a number to a string that is formatted with local numeric formatting style?​

Back

for/in

Front

To execute the same statement or command block for all the properties within a custom object, you can use the ____ statement.

Back

True

Front

T/F You can use the Math object directly in your programs without instantiating a new object.

Back

true

Front

T/F The value of an object property can be another object.​

Back

var manifest = {};

Front

What statement would you use to create a new empty object with the name manifest using an object literal?

Back

number

Front

The ____ class contains methods for manipulating numbers and properties that contain static values representing some of the numeric limitations in the JavaScript language.

Back

providing code for the method in the object. Or by referencing an external function. varorder = { items: {}, generateInvoice: processOrder };

Front

Describe two ways of adding a method to an object. Include sample code.

Back

math

Front

The ____ class contains methods and properties for performing mathematical calculations in your programs.

Back

Date

Front

The ____ class contains methods and properties for manipulating the date and time.

Back

commas

Front

When creating an object using a literal, you separate multiple property-value pairs with ____.​

Back

you specify the property name within the braces followed by a colon and it's value.

Front

How do you declare a property within an object literal?

Back

value from 0-11

Front

When working with a date, JavaScript stores the month as a ____.

Back

Because you can't create your own classes in javascript.

Front

Why is JavaScript said to be an object-based programming language?

Back

Date

Front

Which class requires you to use a constructor?​

Back

var manifest = { itemNum: 1501 };

Front

What single statement would you use to create a new empty object with the name manifest that includes a property named itemNum with a value of?

Back

false

Front

T/F The code for a method must be stored in an external function.​

Back

instance

Front

A(n) ____ is an object that has been created from an existing class.

Back

numeric

Front

You can append the name of any Number class method or property to the name of an existing variable that contains a(n) ____________________ value.​

Back

true

Front

T/F You can create an empty object by assigning a pair of empty braces to a variable name.

Back

delete

Front

To delete a specific property in a custom object, you use the ____ operator.

Back

Math class contains methods and properties for object based calculations in programs. Math Class does not have a constructor. Number class contains methods for manipulating numbers and properties that contain static values representing some of the numeric limitations in javascript.

Front

Explain the difference between the Number and Math classes.

Back

manifest.itemNum = 1501;

Front

What statement would you use to add a property named itemNum to the manifest object, and assign the property a numeric value of ?

Back

false

Front

T/F The code new Date() creates an empty Date object.

Back

black box

Front

The code (methods and statements) and data (variables and constants) contained in an encapsulated object are accessed through a(n) ____.

Back

floor()

Front

Which method of the Math object rounds a value to the next lowest integer?​

Back

toLocaleString()

Front

Which method of the Number class do you use to convert a number to a string that is formatted with local numeric formatting style?

Back

Garbage collection

Front

____ refers to cleaning up, or reclaiming, memory that is reserved by a program.

Back

this

Front

To add a property to a constructor function, you must add a statement to the function body that uses the ____ keyword.​

Back

declare it in the object definition declare its value

Front

Describe two ways of adding properties to an object.

Back

prototype

Front

The ____ property is a built-in property that specifies the constructor from which an object was instantiated.

Back