JavaScript Flashcards

1
Q

Which method converts a string value to uppercase letters?

A

toUpperCase()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which event occurs when the loading of an image is terminated?

A

abort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which event occurs when a user clicks the mouse button outside of a particular input field?

A

blur

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which event occurs when the user clicks on a link or form element?

A

click

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which event occurs when a user modifies the value of a form field?

A

change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which event occurs when there is a problem loading an external image or resource?

A

error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which event occurs when a user clicks into a form field?

A

focus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which event occurs when a page is opened?

A

load

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which event occurs when the user moves the mouse pointer over a link, image or other visible element on a page?

A

mouseOver

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which event occurs when the mouse pointer leaves a link, image or other visible element on a page?

A

mouseOut

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which event occurs when a form’s Reset button is clicked?

A

reset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which event occurs when the user highlights the text in a form field?

A

select

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which event occurs when a form’s Submit button is clicked?

A

submit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which event occurs when a page closed?

A

unload

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are attributes of an object, such as height, color, font size, sentence length and so forth?

A

properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are actions that an object can be made to perform?

A

methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which method creates a pop-up box with the specified message string, which the user can dismiss by clicking a button in the box?

A

alert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which method creates a pop-up box with the specified message string and requests user input into a text field in the box?

A

prompt()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which method creates a pop-up box with the specified message string and requests user confirmation by clicking the OK or Cancel button in the box?

A

confirm()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which method writes the specified message string in the page?

A

document.write()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a named space of memory?

A

variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which operator is used to assign values?

A

=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which data type holds any numeric value used for mathematical operations?

A

number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Which data type holds any string of alphanumeric characters used for words or for numbered phrases that are not mathematically manipulated?

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Which expression creates a string value?

A

var birthYear = “1956”

The quotes around 1956 make it a string value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Which expression creates an integer value?

A

var birthYear = 1956

If 1956 had quotes around it, it would no longer be an integer, it would become a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Which data type holds True or False values only?

A

Boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Which value indicates that a user enters nothing in a text box then submits the form?

A

null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Which value indicates that a variable has no value assigned yet?

A

undefined

30
Q

What is a part of a statement that is evaluated as a value?

A

expression

31
Q

What is a symbol or character used in expressions to store or evaluate a value?

A

operator

32
Q

Which type of operator assigns a value to a variable using the equal symbol?

Example: myNumber = 25

A

Assignment

33
Q

Which type of operator evaluates to a number?

Example: 25 + 75

A

Arithmetic

34
Q

Which type of operator will evaluate to true or false?

Example: 5 != 15

A

Logical

35
Q

Which type of operator compares two values and returns a true or false value?

Example: z == 10

A

Comparison

36
Q

Which type of operator makes decisions in a script?

Example: (a > b) ? a++ : a–

A

Conditional

37
Q

What process combines text strings using the plus sign?

Example: “hello” + “world”

A

concatenation

38
Q

What is a named set of statements that performs a task or calculates a value?

A

function

let x = myFunction(4, 3);

function myFunction(a, b) {
return a * b;
}

39
Q

How do you declare a function?

A

function myFunction(parameter1, parameter2) {
// code to be executed
}

40
Q

What processes a function’s statements?

A

calling statement

41
Q

What happens if you define a function but do not call it?

A

nothing

42
Q

What is the name of this function?

function myFunction(){
return “success”;
}

A

myFunction()

43
Q

What is used to output values from a function?

A

return

44
Q

What type of variable is declared within a function and available only from within that function?

A

local variable

45
Q

What type of variable is available throughout the entire script?

A

global variable

46
Q

What is a value or expression containing data or code that is passed on to a function?

A

argument

47
Q

What describes when values are passed to a function, and the function’s parameters receive a copy of its argument’s value?

Example:
function myFunction(x){
return x;
}
var num = 2;
myFunction(num);

A

pass by reference

48
Q

What describes when values are passed to a function, and the function’s parameters receive its argument’s actual value?

Example:
function myFunction(x){
return x;
}
myFunction(2);

A

pass by value

49
Q

Which method determines whether a value is a number?

A

isNaN()

50
Q

Which method converts a string to its integer equivalent?

A

parseInt()

51
Q

Which method converts a string to its floating-point decimal equivalent?

A

parseFloat()

52
Q

Which errors are typically syntax errors and usually cause error alerts?

A

Load-time errors

53
Q

Which errors occur after the script has loaded and is running, typically caused by improper use of commands?

A

Run-time errors

54
Q

Which errors are mathematical , casting errors, errors in proper command usage or errors in the structure of the script, which result in the script running improperly?

A

Logic errors

55
Q

What is the actual data values you provide in JavaScript?

A

literal

56
Q

What is a self-contained programming component that contains properties and methods?

A

object

57
Q

What is a reference technique used to access a property or method of an object?

A

dot notation

58
Q

What are key characteristics and features of JavaScript?

A

an object-based language
based upon an event-driven model
is platform-independent
enables quick development
is relatively easy to learn

59
Q

Does JavaScript perform its functionality primarily on the client or server-side?

A

client side

60
Q

Which technique adds JavaScript to a single web page within either the <head> or <body>?

A

embedded scripting

61
Q

Which technique adds JavaScript to a single HTML element?

A

inline scripting

62
Q

Which technique adds JavaScript by linking web pages to a text file with the .js file name extension?

A

external scripting

63
Q

How do you apply inline scripting to an element?

A

<a href=”#” onMouseOver=”helloFunction();”>Click Here</a>

64
Q

What must variable names begin with?

A

a letter,
the underscore ( _ ), or
the dollar sign ( $ )

A variable cannot begin with a number!

65
Q

Are these variables the same or unique?

var Result
var result
var RESULT

A

unique

66
Q

Which object allows you to determine information about the user’s browser?

A

navigator

67
Q

Which property returns a string value indicating the name of the client browser?

A

navigator.appName

68
Q

Which property returns a string value indicating the version number of the client browser, as well as the client’s platform?

A

navigator.appVersion

69
Q

What is the value of myVar after execution?

function counter(x) {
return x + 1;
}
var myVar = 0;
counter(myVar);
alert(myVar);

A

0

70
Q

What will the alert box display?

var subTotal = 1;
var tax = 0.03;
alert(“The total is “ + subTotal * (1 + tax));

A

The total is 1.03