JavaScript

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

When creating an array in JavaScript using var myArray = new Array();, Array() is called a __________.

Constructor

The for loop contains how many expressions separated by semicolons?

Three

The following call to a JavaScript function is valid. <form> <input type="button" value="Welcome" onClick="greetings('Students');"> </form>

True

To declare a constant, a value that cannot be changed during programming execution requires the use of keyword __________.

const

Which of the following is not a valid data type of that a variable can hold?

const

The comparison operator != = is used to determine what?

If two operands are not identical in value and type

JavaScript can __________.

Improve website usability.

JavaScript programs are executed by a JavaScript _________ in a Web browser.

Interpreter

A JavaScript function can be called using the HTML anchor tag element, for example <a href="JavaScript:greetings()">Click here</a>

True

Functions in JavaScript are self-contained units of program written to accomplish a specific task

True

In JavaScript the following code examples have equivalent results. Example 1: dog.breed = "German Shepard"; Example 2: dog["breed"] = "German Shepard";

True

Composite data types, also known as complex types, consist of more than one component. Valid composite data types include all of the following except __________.

Undefined

When does an HTML document become a document object?

When the HTML document is loaded in a web browser

Anonymous functions in JavaScript are unique because its definition is assigned to a __________ since they don't have a __________.

variable name

What are the three looping constructs in JavaScript?

while, do/while, for

When a function is defined in JavaScript the expected received data values are called?

Parameters

The ternary operator, which can be used to replace an if/else conditional statement, requires how many operands?

3

Well-formed statements written in JavaScript end with __________.

;

Regular functions must include which of the following? Keyword function Parenthesis Curly braces

All of these

When passing data to a function in JavaScript which of the following statements is true? Data values passed to a function are called arguments Multiple data values passed to a function are separated using a comma Data values passed to a function are enclosed in parentheses

All of these

After a function has been declared in the <head></head> section of the HTML document, how many times can it be used in the <body></body>?

As many times as required

What is the purpose of a prompt() dialog box?

Ask the user for information

What type of JavaScript array is displayed below using key/value pairs? var states = new Array(); states["CA"] = "90210"; states["ME"] = "01234"; states["MT"] = "55641"; states["FL"] = "32829";

Associative array

Recursion is a function that __________.

Calls itself

When using the Array object in JavaScript the data types stored in each element of the array must be the same.

False

When using the Math object a programmer MUST create an instance of the JavaScript core object by calling the constructor (i.e. Math math = new Math()).

False

What are logical errors in a JavaScript program?

Faulty logic in JS

Variables declared outside of functions that can be used or changed anywhere in the program are called __________.

Global variables

When using the typeof() function what does a value of null mean?

No valid data type

When calling a declared function setLetter(word, letter, display) how many arguments must be passed for the function to run?

None are required to run, but you may not get the result you wanted

Local variables are declared inside of JavaScript functions and can be used or modified __________.

Only in function they are declared

When asked to develop unobtrusive JavaScript this means that the JavaScript is __________.

Stored in an external file with a .js file extension

What is the primary difference between a while loop and a do/while loop?

While loops executes 0...n times; do/while loop executes 1...n times

Decision-making constructs for control flow such as if, if/else, if/else if, and switch are called

control expressions

&& and || are called what in JavaScript?

logical operators


Set pelajaran terkait

PDBIO 210--Lesson 3 (part 7) --Dermis

View Set

Ch. 17 Physical Activity Epidemiology Research

View Set

Maternity & Women's Health Care- Chapter 12: Conception and Fetal Development

View Set

bio 102 unit 4 cumulative practice

View Set

Chapter 12 Electrical and electronic control devices

View Set

MAN3303 - Leadership & Management - Chapter 4 Quiz

View Set