JavaScript Certification Test

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/104

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

105 Terms

1
New cards

Which of the following escape sequences will print the backslash character?

\\

2
New cards

Which of the following characters matches the start of a line in a regular expression

^

3
New cards

What is the main role of JavaScript in an AJAX transaction?

To request XML or plain text data from a web server

4
New cards

Which property is used to add CSS styles to elements in a Web Page?

HTMLElement.style

5
New cards

What is a bug in the JavaScript code?

An error in the code

6
New cards

Which of the following is not a valid property?

coords.timestamp

7
New cards

What readyState value specifies that the response header has been received, but the message body is yet to be received?

3

8
New cards

Which of the following casting rules is incorrect when concatenating? (true is a Boolean value)

9 + true equals "9true"

9
New cards

Which of the following statements is true of semicolons in JavaScript?

Semicolons are essential while combining separate statements in a line

10
New cards

Which statement is false in reference of XSS attacks?

They cannot be performed through emails or mail clients

11
New cards

Sarah has created a JavaScript library, and now she wants to include it in her document. Which of the following statements follows the correct syntax to link the library in her document?

12
New cards

Which of the following information is not a part of the cookie header?

expires = date

13
New cards

Which of the following is not true of JavaScript plug-in?

Plug-ins cannot be used without the library they depend upon; Every pre-made script is a library

14
New cards

How can a cookie be deleted using JavaScript?

By setting a passed expiration date

15
New cards

Which event is triggered on the

onchange

16
New cards

Which of the following methods will remove all the data from the storage?

localStorage.clear();

17
New cards

Which of the following initializes the HTTP request in an AJAX transaction?

The open() method

18
New cards

What is a named memory block that serves as containers for a value called?

Operator

Variable

19
New cards

Which of the following solutions will not help in preventing XSS attacks?

Storing login credentials in cookies for security

20
New cards

Which of the following characters is used as the escape character in JavaScript?

\

21
New cards

Which of the following statements is not true of the XMLHttpRequest object?

It transfers the data between a client and server

22
New cards

Which of the following statements is not true of the window object?

It is subordinate to the navigator object

23
New cards

Which method of the history object is used to create a new history entry

pushState()

24
New cards

Which of the following objects is used to get information about the user's browser

navigator

25
New cards

Which of the following is a major advantage of using the appendChild() Method?

It can be used to add elements to the DOM without overwriting the existing page

26
New cards

Which programming language is typically used in AJAX transactions to query databases?

SQL

27
New cards

Which of the following is true when using AJAX with databases?

AJAX can perform all back-end database operations

28
New cards

Which of the following input types masks the value entered by users?

password

29
New cards

A user enters confidential data on a web site while performing a task. This data was redisplayed on the Web page, after the task was completed. The data sent between the server and browser was not encoded as HTML entities. Which of the following vulnerabilities will this result?

Non-persistent XSS

30
New cards

Why does the Array.sort() method produce unreliable results when elements of an array are numbers?

The sort() method treats numbers as strings and sorts them accordingly

31
New cards

Which method can be used to increase option elements in a select statement?

add()

32
New cards

Which of the following technologies is not based on JavaScript?

Java

33
New cards

Which of the following is true of the getElementById() method?

It return the first occurrence of an element in a document with the specified id

34
New cards

Which of the following is a disadvantage associated with the use of JavaScript frameworks?

JavaScript frameworks are large in size

35
New cards

Which of the following error types are the hardest to debug?

Logic

36
New cards

Which of the following characters is used by jQuery as a reference to itself?

$

37
New cards

Which of the following is not true of the element?

It has drawing capabilities

38
New cards

Which of the following uses of a cookie may compromise a user's security?

Authenticate a user

39
New cards

Which of the following requests the transfer of data between a server and client?

XMLHttpRequest

40
New cards

Which of the following variables will be present as a property on the window object?

var x= 5

41
New cards

Which property of the image object can be used to check if the image has finished loading?

complete

42
New cards

Which property of the image object returns the number of elements in a form?

length

43
New cards

Which of the following statements is true of the substr() method?

It takes the starting index and the number of characters to extract

44
New cards

Which of the following statements is not true of the variables declared using the let keyword?

Variables declared using let are hoisted

45
New cards

Which method is used to delete a child object of a parent element?

removeChild()

46
New cards

Which of the following loops should you use if a loop must run at least once even if the condition is false?

do while

47
New cards

Which of the following languages has JavaScript least in common with?

VBScript

48
New cards

A function block is enclosed with?

{}

49
New cards

Which of the following statements is identified as a jQuery statement by the interpreter?

$("button").click()

50
New cards

Which of the following statements is not true of jQuery

It focuses on server-side scripting

51
New cards

When does the load event occur?

When a page finishes loading

52
New cards

Which of the following adds a color picker on the Web page and specifies the default color as red?

53
New cards

What is the correct syntax of changing the CSS style of an HTML element?

Htmlelement.style.property = value

54
New cards

Which of the following is an arithmetic operator?

%=

55
New cards

Which of the following expressions uses the correct hierarchy?

window.document.forms.length;

56
New cards

Which method initializes an HTTP request()?

open()

57
New cards

Which of the following cannot be used to perform concatenation in JavaScript?

++

58
New cards

Which of the following references is invalid

timestamp.accuracy

59
New cards

Which of the following statements will return an array of all images in a document?

document.getElementsByTagName("img")

60
New cards

Which of the following conditions will return false? Consider X and Z to be true and Y to be false.

Y&&Z

61
New cards

What technology is not a server-side scripting environment ?

jQuery

62
New cards

Which of the following is an invalid parameter in reference to a cookie header?

name=name_cookie

63
New cards

Which of the following is not a property of a Position object?

geolocation

64
New cards

Which of the following is true of the String.slice() method?

Return a section of the string

65
New cards

Which of the following code blocks calls a function example() from an external script sample.js?

66
New cards

Which of the following is not true of copyleft?

A code library that uses another copyleft can be distributed for a charge

67
New cards

Which of the following statements about inheritance is JavaScript is true?

JavaScript support both prototypal and call-based inheritance

68
New cards

Which of the following coding practices may augment to security issues in a page?

Use browser-specific code

69
New cards

Methods like floor(), ceil() and sin() are associated with which object?

Math

70
New cards

Which of the following objects can be used to access cookies?

document

71
New cards

Which form event handler executes the specified code when the value of an element is modified from the default?

onchange

72
New cards

Which HTML element serves as a container for graphics on a Web page?

73
New cards

Which form object will you use to mask the value entered by a user?

password

74
New cards

Which of the following statements will execute only if the conditions A and B are true?

Run-Time

75
New cards

Which of the following languages is not a scripting language?

Java

76
New cards

Which of the following hierarchical dot notations is an invalid reference?

document.history

77
New cards

Which of the following is true of the variables declared using let and const?

Variables declared using const must be initialized at declaration, while the variables declared using let can be initialized anywhere

78
New cards

Which of the following constitutes an XSS attack?

A hyperlink that carries malicious content

79
New cards

You created a webpage containing a form for user's to join your company's mailing list. You need to validate user input with the minimum amount of bandwidth. Which technology should you use?

Client-Side JavaScript

80
New cards

Correct syntax for declaring a variable

var_LAST_name

81
New cards

Which JavaScript Event Handler is triggered when a user clicks her mouse button outside a particular field after typing input there?

onblur

82
New cards

Technique of changing variables from one data type to another?

Casting

83
New cards

Disadvantage to using JavaScript libraries

Does not guarantee high quality secure code

84
New cards

Which JavaScript "flavor" attempts to diminish the differences between other JavaScript flavors and standardize the language?

ECMAScript

85
New cards

select object that loses focus after a user makes a selection, but only if it's a selection other than the default

onchange

86
New cards

Which statement about the prototype property is true?

It's available in all objects

87
New cards

What was Server-Side JavaScript (SSJS) originally called?

LiveWire

88
New cards

Which of the following will correctly retrieve the corresponding value of an HTML element's attribute within the DOM?

getAttribute(AttributeName)

89
New cards

Which code is the JavaScript equivalent of clicking the browser's Back button?

history.go(-1)

90
New cards

What is the purpose of the break statement in JavaScript?

To exit a control structure

91
New cards

Which method will bring a window object to the top?

window.focus()

92
New cards

In an AJAX transaction, which readyState value indicates that the XMLHttpRequest has been sent but no response has been received yet?

readyState value 2

93
New cards

Which variable data type is a variable that has not yet had a value assigned to it?

Undefined

94
New cards

Which JavaScript object reflects information about the browser being used to view the Web page?

navigator

95
New cards

Cross-site scripting (XSS) is a type of:

code-injection attack

96
New cards

Which type of error are you most likely to debug using watchpoints?

Logic Error

97
New cards

What are cookies?

Small pieces of information sent to a client computer

98
New cards

What makes a scripting language different from a programming language?

Scripting languages are interpreted and programming languages are compiled.

99
New cards

Which of the following is not a valid variable name in JavaScript?

this

100
New cards

Which browser security consideration should a JavaScript developer remember when developing a script?

JavaScript can be disabled by the user and therefore cannot be relied upon to run.