chevron_left
0 points
15 11 8

Q. Which method returns all h1 elements in a document?

getElementsByTagName(“h1“)

Q. Which of the following is NOT one of the three testing phases of a JavaScript application?

DOM

Q. Which results in a node that exists independently of the DOM tree?​

createElement()

Q. TF The Web Storage API is supported by all browsers in use on the web today.

FALSE

Q. function start(){ while(true) { var roll1 = Randomizer.nextInt(1,6); var roll2 = Randomizer.nextInt(1,6); if (roll1 && roll2 == 1){ break; } println(“You rolled: “ + roll1 + “, “ + roll2); } }

4.10.4: Snake Eyes

Q. ____ refers to programming using a scripting language that is executed from a web server.

Server-side scripting

Q. Which is the correct way to reference the href attribute of the element with the id value homeLink?​

document.getElementById(“homeLink“).href

Q. The ____ method is used in JavaScript to execute code after a specific amount of time has elapsed. a. clearInterval() b. clearTimeout() c. setTimeout() d. startTimeout()

setTimeout()

Q. The code new Date() creates an empty Date object. a. True b. False

FALSE

Q. You can place script elements in either the document head or in the document body. a. True b. False

TRUE

Q. A ____ statement restarts a loop with a new iteration.

continue

Q. Which of the following is a valid JavaScript variable name?

BR549

Q. A program‘s ____ is the order in which various parts of the program run, or execute. a. logic b. syntax c. call stack d. console

logic

Q. A three-tier, or multitier, client/server system consists of three distinct pieces: These are ____. a. the client tier, the processing tier, and the data storage tier b. the client tier, the design tier, and the processing tier c. the storage tier, the distributing tier, and the processing tier d. the email tier, the messaging tier, and the data storage tier

a. the client tier, the processing tier, and the data storage tier

Q. Select the valid JavaScript variable name below: a. prompt b. myName c. my Name d. visitor‘sName

myName

Q. To convert a JavaScript object to a JSON string, you use the ____ method.

stringify()

Q. You enclose code that may contain an exception in a ____ statement. a. throw b. catch c. throws d. try

try

Q. How can a javascript developer modify a scalar global variable from within a function?

Refer to the global variable by its name

Q. var MAX = 1000; function start(){ var firstNum = 0; var secondNum = 1; println(“1“); while (firstNum + secondNum < MAX){ var answer = firstNum + secondNum; firstNum = secondNum; secondNum = answer; println(answer); } }

4.9.5: Fibonacci

Q. When using the console.log() method to trace bugs, it can be helpful to use a ____ program. a. script b. hub c. tracing d. driver

driver

Q. Where is the correct place to insert a JavaScript? The <body> section Both the <head> section and the <body> section are correct The <head> section

B

Q. In JavaScript, 17%5 is:

2

Q. Assistive functions perform a type of validation. a. True b. False

FALSE

Q. Which of the following is NOT one of the three testing phases of a JavaScript application?

Checking the error console

Q. In order to make a window the active window, you use the ____ method of the Window object.

focus()

Q. Before you use a variable in a JavaScript program, you should ____ it. a. compile b. concatenate c. declare d. nullify

c. declare

Q. Which attribute enhances usability in modern browsers? a. id b. src c. placeholder d. value

placeholder

Q. Why is it, in general, a good idea to leave the global scope of a website as-is and never touch it?

You may end up causing a clash in the global namespace

Q. You can place script elements in either the document head or in the document body. a. True b. False

TRUE

Q. JSON, JavaScript Object Notation, is useful because it

allows web services to exchange information

Q. Regular expression patterns consist of literal characters and ____.

metacharacters

Q. Which of the following should you NOT collect with the Google Analytics ecommerce JavaScript? a) tax amount b) credit card number c) billing city d) purchase amount e) product SKU(s)

b) credit card number

Q. Objects are also called ____. a. data b. functions c. methods d. components

components

Q. A ______ is an attribute or characteristic of an object.

property

Q. The value of the responseText property is almost always a(n) ____ string.​

JSON

Q. The String class ____ property returns the number of characters in a string. a. elements b. size c. length d. maxIndex

length

Q. which of the following is a valid javascript variable name? A) 0123 B)37AB C)BR549 D) tax rate

C

Q. The getElementsBySelector() method returns a collection of elements matching a specified selector. a. True b. False

FALSE

Q. Programming languages are most helpful to programmers because they:

A. are precise (pg 539)

Q. T/F The value of an object property can be another object.​

TRUE

Q. Which of the following statements is false? A JavaScript identifier

Can start with a number

Q. The cookie property is created with a required ____ attribute.

name

Q. Which of the following is true about client-side JavaScript?

It needs HTML to run.

Q. Which type value for the input element triggers validation in modern browsers?​

number


If you found any kind of mistake, like wrong answers or anything syntactical, Please let us know. It will help us in improving content for you guys.

More Posts

JavaScript Online Quiz Questions Answers 2 Lalit Kumar - Jan 12
JavaScript Online Quiz Questions Answers 1 Lalit Kumar - Jan 12
Android Online Quiz Questions Answers 2 Lalit Kumar - Jan 17
Android Online Quiz Questions Answers 1 Lalit Kumar - Jan 16
AJAX Online Quiz Questions Answers Lalit Kumar - Jan 16
MySQL Online Quiz Questions Answers 2 Lalit Kumar - Jan 15
MySQL Online Quiz Questions Answers 1 Lalit Kumar - Jan 15
CSS Online Quiz Questions Answers 2 Lalit Kumar - Jan 15
CSS Online Quiz Questions Answers 1 Lalit Kumar - Jan 15
C++ Online Quiz Questions Answers 2 Lalit Kumar - Jan 13