JavaScript Final Review

JavaScript Final Review

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

What does the following code do? myhouse.kitchen = "big"; -Assuming the kitchen object exists, the myhouse property is assigned a new string value. -Assuming the myhouse object exists, the value of the variable kitchen is added to the string big. -Assuming the myhouse object exists, the kitchen property is assigned a new string value of "big", or the kitchen property is created and initialized with the string value "big". -This wouldn't do anything.

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

7 years ago

Date created

Mar 1, 2020

Cards (55)

Section 1

(50 cards)

What does the following code do? myhouse.kitchen = "big"; -Assuming the kitchen object exists, the myhouse property is assigned a new string value. -Assuming the myhouse object exists, the value of the variable kitchen is added to the string big. -Assuming the myhouse object exists, the kitchen property is assigned a new string value of "big", or the kitchen property is created and initialized with the string value "big". -This wouldn't do anything.

Front

Assuming the myhouse object exists, the kitchen property is assigned a new string value of "big", or the kitchen property is created and initialized with the string value "big".

Back

Match the event object property with the information it provides... keyCode target timestamp type Other Incorrect Match Options: The data type The time to wait before executing the event handler function The event handler function for the event

Front

What key was pressed The object that the event occured on when the event occured The type of event

Back

One or more characters of text is referred to as a in programming. sentence -word -phrase -string

Front

string

Back

An event is created for every event. It contains information about the event. -schedule -notification -object -None of the above

Front

object

Back

Pseudocode is a generic programming like language written in English used to develop computer programs. -True -False

Front

True

Back

Which of the following methods will convert a string to all uppercase characters? -toUpper -toLower -toCaps -toUpperCase

Front

toUpperCase

Back

The Math object's pow() method returns the numeric value of the first argument raised to the power of the second argument? -True -False

Front

true

Back

Before doing anything other step in the Software Development Life Cycle you should always write the program. -True -False

Front

False

Back

You can pass arguments to methods, just like you can to regular functions? -True -False

Front

True

Back

When creating an object using object literal notation: What punctuation is used to separate each property name and value pair (except for the last property name and value pair) declared in an object? -semi-colon (;) -period (.) -comma (,) -exclamation point (!)

Front

comma (,)

Back

Changing the contents of an HTML element using the innerHTML property permanently changes the document; each time the page (document) is loaded, or reloaded, these changes will be retained? -True -False

Front

False

Back

One use of JavaScript is to add _____to a web page? -Style -user interactivity -Structure -None of the above

Front

user interactivity

Back

When using object literal notation to create an object, the properties and values are enclosed within curly braces ({})? -True -False

Front

true

Back

Which of the following will write the value of Pi to the page? -document.write(Math.Pi) -document.write(Math.pi) -document.write(Math.PI) -document.write(Date.PI)

Front

document.write(Math.PI)

Back

Functions that handle events are known as event ? -helpers -handlers -tasks -functions

Front

Handlers

Back

JavaScript is a typed language. -stereo -strongly -weakly -none of the above

Front

weakly

Back

Which HTML element is used to insert JavaScript into a web page? -Div -Style -Script -Input

Front

script

Back

What method do you use to get the year from an instance of a Date object? -getYear() -getCurrentYear() -getFullYear() -this.year()

Front

getFullYear()

Back

The JavaScript and Java programming languages are the same? -True -False

Front

False

Back

A method is just like a function except that it is part of an object? -True -False

Front

True

Back

What punctuation is used to indicate the end of a JavaScript statement? Correct! -Semicolon -Colon -Period -Ampersand

Front

Semicolon

Back

The Document Object Model (DOM) is the browser's internal representation of the web page. It allows JavaScript to programmatically access the document (web page)? -True -False

Front

True

Back

In JavaScript, you typically access object properties through the use of the? -addition operator (+) -dot operator (.) -multiplication operator -You can't access the properties of an object

Front

dot operator (.)

Back

What does the following code do? var x = myhouse.kitchen; -It assigns the string myhouse.kitchen to the variable x. -It adds the values of myhouse and kitchen and assigns them to an object named x. -Assuming the myhouse object exists, it assigns the value of the kitchen property of the myhouse object to the variable x. -Assuming the kitchen object exists, it assigns the value of the myhouse property of the kitchen object to the variable x.

Front

Assuming the myhouse object exists, it assigns the value of the kitchen property of the myhouse object to the variable x.

Back

The window.onload event fires when? -The browser is opened -It is fired upon -The document has finished loading

Front

The document has finished loading

Back

What does this code do? var now = new Date(); -Creates an instance of a blank date object -Gets the value of a Date object in milliseconds -Gets the string representation of a Date object -Creates an instance of a Date object with the current date and time

Front

Creates an instance of a Date object with the current date and time

Back

JavaScript reserved words are words that JavaScript keeps for its own use. -True -False

Front

True

Back

What operator is used to remove a property from an object? -delete -remove -erase -scrub

Front

delete

Back

The following are common types of data in computing: Numeric String Boolean -True -False

Front

True

Back

What does the getElementById method return if the id doesn't exist on the web page? -nothing -undefined -not found -null

Front

null

Back

The string length property returns the number of characters in a string. -True -False

Front

true

Back

What is step one of the Software Development Life Cycle? -Write the program -Define the problem -Test the program -Design the solution

Front

define the problem

Back

If too many events happen close together the browser will store the events in the event until it can process them. -stack -queue -heap -folder

Front

queue

Back

What must be created before you can use the Date object's properties and methods? -a string -a number to reference the date -a time for the date to be set to -an instance of the Date object

Front

an instance of the Date object

Back

When does the event handler for the window's onload property get called? -When the web page (document) starts loading -Just before you close, or leave, the web page (document) -After the web page (document) has completely loaded -None of the above

Front

After the web page (document) has completely loaded

Back

The Document Object Model (DOM) allows you to? -Get elements from the DOM -Create, add, and remove elements in the DOM -Traverse the elements of the DOM -All of the above

Front

All of the above

Back

An object is a collection of? -variables and values -functions and values -properties and values -stand alone variables and functions

Front

properties and values

Back

The innerHTML property of an element allows you to change the content inside an HTML element? -True -False

Front

True

Back

Objects can be created in the following ways: with just data properties; just methods; or a combination of the two. Correct! -True -False

Front

True

Back

Which string method returns the character at the "x" position within the string? -indexOf(x) -charAt(x) -charCodeAt(x) -lastIndexOf(x)

Front

charAt(x)

Back

The getMonth method returns the number of the month that coincides with the actual month (1 for Jan., 2 for Feb., etc)? -True -False

Front

false

Back

JavaScript is an example of a level computer language. -Mid -Low -High -Sub

Front

High

Back

What does the following code return? var jsMaster = "I am a JavaScript Ninja. Ninja of JavaScript am I."; jsMaster.indexOf("ja"); -21 -ja -29 -Ninja

Front

21

Back

The following is an example of ? Declare three numeric variables: number1, number2, sum Display "Enter number 1" Get number1 Display "Enter number 2" Get number2 sum = number1 + number 2 Display "The sum of the two numbers is: " + sum -An algorithm -JavaScript code -Pseudocode -I don't know

Front

Pseudocode

Back

The method of the document object allows you to get an element by the value of its id attribute. -getId -getById -getElementById -getElement

Front

getElementById

Back

The following is an example of a(n) ____. Processing a sales order: 1. Start a new sales order 2. While there are still items to be processed: → Get the quantity and price of the next item → Multiply the quantity by the price to get the total cost for the item → Add the item's total cost to the running total purchase price 3. Multiply the total purchase price by the 6% sales tax rate to get the sales tax amount 4. Ask the customer to choose none, ground or air shipping: → If not being shipped, set the shipping charge to $0 → If ground shipping, set the shipping charge to $10 → If air shipping, set the shipping charge to $20 5. Add the total purchase price, the sales tax amount, and the shipping charge to get the order total and complete the sales order. -assignment statement -algorithm -named constant -machine language

Front

algorithm

Back

The following is an example of . 1. Get number1 2. Get number2 3. Sum = number1 + number2 4. Display the calculated sum of number1 and number2 -an algorithm -a JavaScript program -pseudocode

Front

pseudocode

Back

The object is an object that is created by the browser for each new HTML page that is viewed. -page -document -window -element

Front

document

Back

The following are examples of . 5 "To be or not to be" -boolean data values -string values -numeric values -a numeric value and a string value

Front

a numeric vale and a string value

Back

The innerHTML property holds the text content, as well as all nested HTML content, of an element? -True -False

Front

True

Back

Section 2

(5 cards)

The following is an example of ? Ask for two numbers sum the two numbers record the sum for later use -An algorithm -JavaScript code -Pseudocode -I don't know

Front

An algorithm

Back

To react to an event you need to have an registered. -event -event handler function -event object -event array

Front

event handler function

Back

Event handler functions can be run at any time, they are not restricted to sequential processing? -True -False

Front

True

Back

Code that is only invoked if and when an event occurs is called? -Asynchronous code -Linear code -Step by step code -Sequential code

Front

Asynchronous code

Back

Use the method to create a time based event that will execute only once after a specified amount of time? -setInterval -setWait -setTimeout -runOnce

Front

SetTimeout

Back