JavaScript Flashcards

1
Q

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

A

Load-time errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
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
3
Q

Which methods determines whether a value is a number?

A

isNaN()

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

What process combines two text strings using the plus sign?

A

concatenation

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

Which method converts a string to its integer equivalent?

A

parseInt()

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

What processes a function’s statements?

A

calling statement

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

Which type of operator is this?

25 + 75

A

Arithmetic

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

Which expression creates an integer value?

A

var birthYear = 1956

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

How does a for loop start?

A

for (i = 0; i <= 5; i++)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
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
11
Q

What is a way of changing a variable from one data type to another?

A

casting

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

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

A

dot notation

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

Which type of operator is this?

myNumber = 25

A

Assignment

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

Which operator is used to assign values?

A

=

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

Which expression creates a string value?

A

var name = “Andrew”

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

What is the actual data values you provide in JS?

A

literal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
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
18
Q

What does a one line JS comment look like?

A

// this

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
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
20
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
21
Q

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

A

local variable

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

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

A

parseFloat()

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

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

A

operator

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

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

A

expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you declare a function?
function myFunction() {}
26
What is a self-contained programming component that contains properties and methods?
object
27
What are key characteristics and features of JavaScript?
an object-based language based on event-driven model platform independent enables quick development relatively easy to learn
28
How do you apply inline scripting to an element?
29
Which event occurs when the user modifies the value of a form field?
change
30
Which event occurs when the user clicks on a link or form element?
click
31
Which type of operator is this? 25 < 75
Logical
32
What happens if you define a function but do not call it?
nothing
33
Which method creates a pop up box with the specified message string and requests user input into the text field in the box?
prompt()
34
What is a named set of statements that performs a task or calculates a value?
function
35
How do you call this function? ``` function myFunction() { return “success”; } ```
myFunction()
36
Which event occurs when a page is closed?
unload
37
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?
Logic errors
38
Which technique adds JS to a singe web page within either the or the ?
embedded scripting
39
Which object allows you to determine information about the user’s browser?
navigator
40
Which method creates a pop-up box with the specified message string, which the user can dismiss by clicking a button in the box?
alert()
41
Which property returns a string value indicating the name of the client browser?
navigator.appName
42
Which technique adds JavaScript to a single HTML element?
Inline scripting
43
How do you find a number with the highest value of x and y?
Math.max(x,y)
44
What must variable names begin with?
a letter the underscore _ the dollar sign $
45
Which technique adds JS by linking web pages to a text file with the .js file name extension?
external scripting
46
What is a value or expression containing data or code that is passed on to a function?
argument
47
How do you round the number 7.25 to the nearest integer?
Math.round(7.25)
48
Which event occurs when there is a problem loading an external image or resource?
error
49
What does a JS comment with more than one line look like?
``` /* like this */ ```
50
What is a named space of memory?
variable
51
Which event occurs when a form’s Submit button is clicked?
submit
52
Which data type holds True or False values only?
Boolean
53
What are actions that an object can be made to perform?
methods
54
What type of variable is available throughout the entire script?
global variable
55
Which value indicates that a variable has no value assigned yet?
undefined
56
What are attributes of an object (e.g., height, color, font size, sentence length, etc.)?
Properties
57
What describes when values are passed to a function, and the function’s parameters receive a copy of its arguments values? ``` function myFunction(x) { return x; } ``` ``` var num = 2; myFunction(num); ```
pass by reference
58
What is the correct way to change the content of the HTML element below?

this is a demo

document.getElementById(“demo”).innerHTML = “Hello World!”;
59
What is used to output values from a function?
return
60
Which errors occur after the script has loaded and is running, typically caused by improper use of commands?
Run-time errors
61
Which type of operator is this? z == 10
Comparison
62
Which value indicates that the user enters nothing in a text box then submits the form?
null
63
Which method creates a pop up box with the specified message string and requests user confirmation by clicking OK or Cancel button in the box?
confirm()
64
How do you write an if statement if i is not equal to 5?
if (i != 5)
65
What is the correct syntax to open a new window?
w2 = window.open(“URL”);
66
Which property returns a string value indicating the version number of the client browser and the platform?
navigator.appVersion
67
Which event occurs when a page is opened?
load
68
Which method writes the specified string in the page?
document.write()
69
Which data type holds any string of alphanumeric characters used for words or for numbered phrases that are not mathematically manipulated?
string
70
How to write an if statement in JS?
if (i == 5)
71
Which event occurs when the mouse pointer leaves a link, image, or other visible element on a page?
mouseOut
72
Which event occurs when a firm’s Reset button is clicked?
reset
73
Which event occurs when the loading of an image is terminated?
abort
74
Which event occurs when a user clicks into a form field?
focus
75
Does JS perform its functionality primarily on the client or server-side?
client side
76
What describes when values are passed to a function, and the function’s parameters receive its argument’s actual values? ``` function myFunction(x) { return x; } ``` myFunction(2);
pass by value
77
Which type of operator makes decisions in a script? (a > b) ? a++ : a- -
Conditional
78
How does a while loop start?
while (i <= 10)