Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Web Programming (HTML JavaScript) Question 11 Variables in JavaScript are typed.

ID: 673051 • Letter: W

Question

Web Programming (HTML JavaScript)

Question 11

Variables in JavaScript are typed.

Question 11 options:

Question 12

A variable’s name cannot:

Question 12 options:

Start with a number

Contain a dollar sign

Be a single character long

Be longer than 32 characters long

Question 13

If you declare a variable without assigning it a value, what value will it have?

Question 13 options:

false

o

null

undefined

Question 14

Test expression, false == '0', will generate TRUE value.

Question 14 options:

Question 15

Test expression, null == undefined, will generate FALSE value.

Question 15 options:

Question 16

Which of the following element properties can be used to assign HTML content?

Question 16 options:

textContent

innerText

innerHTML

All of the above

Question 17

What is the epoch in Javascript's Date object?

Question 17 options:

Midnight, January 1, 1960

Midnight, January 1, 1970

Midnight, January 1, 1980

Midnight, January 1, 2000

Question 18

What date and time will the following variable represent?

var d = new Date();

Question 18 options:

The current date and time in the browser.

The current date and time on the server.

Midnight on the current date.

No date or time.

Question 19

December is represented in a Date object as _____.

Question 19 options:

Dec

11

12

13

Question 20

Once you have created a Date object, you cannot change the represented date and/or time.

Question 20 options:

Question 21

Which method converts a string into an array?

Question 21 options:

slice()

split()

toArray()

unjoin()

Question 22

Which of the following is a benefit of creating your own functions?

Question 22 options:

Functions can be used to represent commonly repeated chunks of code.

Functions can limit access to data.

Functions can be reused in different projects.

All of the above.

Question 23

Functions must always have at least one parameter

Question 23 options:

Question 24

If a function definition has three parameters but only two values are passed when the function is called, what will be the result?

Question 24 options:

An “Incorrect number of arguments” error message.

No error message

The third parameter will be assigned the value false.

None of the above.

Question 25

Recursion occurs when _____.

Question 25 options:

A function is called within a loop.

A function calls itself.

A function is defined without a name.

A function is defined within an object.

Question 26

Which of the following is a way to create an event handler?

Question 26 options:

Inline

Traditional

W3C (DOM Level 2)

All of the above

Question 27

Which of the following lines of code will reliably provide a reference to the event that occurred?

Question 27 options:

if (typeof e == 'undefined') e = window.event;

e = e || window.event;

if (!e) e = window.event;

All of the above

True False

Explanation / Answer

Answers:

Answer 11: True. The variables declared in the JavaScript are typed variables and they are loosely typed. A variable declared in the JavaScript can hold different type of variables irrespective of declaring the data type.

Hence, the variables in JavaScript are typed.

Answer 12: A variable declared in the JavaScript can use dollar sign, single character long but does not start with a number.

Hence, the correct answer is a variable’s name cannot start with a number.

Answer 13: If a variable is declared and not assigned with any value, then that variable will contains undefined value.

Hence, the correct answer is undefined.

Answer 14: For any conditional expression in any programming language, always a 0 value is false and a 1 value is true. Here, a false variable is holding a false value. So, it generates a true statement at the output.

Hence, the correct answer is True.

Answer 15: In JavaScript, the falsely statements are undefined, null, NaN, 0 , “” and false values returns only false values.

Here, in the statement, a null value returns false and undefined value returns false. So, a null value is equal to undefined value.

Therefore, the test expression null== undefined will generate TRUE value.

Answer 16: To assign a value to the HTML content, the innerHTML element is used.

Hence, the correct answer is innerHTML.

Answer 17: The data epoch of any programming language is Midnight, January 1, 1970.

Hence, the epoch in Javascript’s Date object is Midnight, January 1, 1970.

Answer 18: The object new Date() that is assigned to the variable d represents the current data and time in the browser.

Hence, the correct answer is current data and time in the browser.

Answer 19: The Date object will returns the name of the months with three characters. So, the month December in Date object is represented as Dec.

Hence, the correct answer is Dec.

Answer 20: The Date object contains a constructor to create an object and to modify or access the Date obeject, getter and setter methods are available.

Hence, once a Date object is created, it can modify the represented date and/or time.

Hence, the correct answer is False.

Answer 21: The split() method will convert the given string into an array.

Hence, the correct answer is split() method.

Answer 22: Functions are created inorder to present the commonly used repeated chunks of code, to limit the access of data, and to reuse the functions in different projects.

Hence, the correction answer is all of the above.

Answer 23: When function is declared and defined, it is not necessary that the function should contain atleast one parameter. A function can be defined without any parameters also.

Hence, the correct answer is False.

Answer 24: If any parameter of the function is not passed to the function, then the result would be false and it returns as NaN value.

Hence, the third parameter will be assigned the value false.

Hence, the correct answer is False.

Answer 25: A recursion is process of dividing the large problem into sub problems until it reaches the base conditions, then revaluates and merges the results of all the sub problems. So, recursion is a function that calls itself.

Hence, the correct answer is a function calls itself.

Answer 26: all of the above.

Answer 27: All the above.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote