Based on the following code fragment, what is the appropriate method to get the maximum value in the array? var arr = [1,2,3]; var max = arr._______ (function(a, b) {     return Math.max(a, b); }); A. fix B. reduce

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter8: Arrays
Section: Chapter Questions
Problem 21RQ
icon
Related questions
Question

1.

Based on the following code fragment, what is the appropriate method to get the maximum value in the array?

var arr = [1,2,3];
var max = arr._______ (function(a, b) {
    return Math.max(a, b);
});

A.

fix

B.

reduce

C.

purge

D.

change

 

2.

Which of the following measurement units of CSS is probably best for handling Chinese or other Asian characters?

A.

pt

B.

px

C.

em

D.

pc

 

3.

Which of the following statements best describe the METHOD of GET / PUT used in a form?

i. GET method transfers parameters in a transparent way and can be seen on URL.

ii. GET method is suitable for transferring image files and/or document files.

iii. PUT method can be used to transfer files of any types and sizes.

iv. PUT method uses HTTP header and so it can be a bit more secure for transferring data.

A.

ii and iii

B.

i and ii

C.

i and iv

D.

ii and iv

 

4.

In a table, the CSS __________ property can be used to specify the amount of space between the borders of each cell.

A.

border-padding

B.

spacing

C.

padding

D.

border-spacing

 

5.

Which of the following statements is TRUE about using a router instead of a switch for connecting a host computer to Internet?

A.

A router can normally do what a switch can do but not necessarily the reverse.

B.

A switch can provide some level of filtering and thus some level of security.

C.

Both router and switch work on data link layer.

D.

A router provides higher bandwidth than a switch.

 

6.

Which of the following Date objects can be used to set a JavaScript cookie to last for 10 minutes?

A.

now=new Date( ); now.setTime(now.getTime( ) + 1000 * 60 * 10);

B.

now=new Date( ); now.setTime(now.getSystemTime( ) + 1000 * 60 * 10);

C.

now=new Date( ); now.getTime(now.setTime( ) + 1000 * 60 * 10);

D.

now=new Date( ); now.setSystemTime(now.getTime( ) + 1000 * 60 * 10);

 

7.

Which of the following options can be used as hexadecimal literal prefixes?

i.  00

ii. 0x

iii. 0X

iv. 0e

A.

i. and ii.

B.

iii. and iv.

C.

ii. and iii.

D.

i. and iv.

 

8.

Based on the HTML code shown below,  which of the following CSS definitions can turn only the <p> element before the last yellow?

<!DOCTYPE html>

<html>

<head>

<style>

      /* Give correct CSS rule here */

</style>

</head>

<body>

<h1>Welcome to My Homepage</h1>

<div>

  <h2>My name is Donald</h2>

  <p>I live in Duckburg.</p>

</div>

<p>My best friend is Mickey.</p>

<p>I will not be styled.</p>

</body>

</html>

A.

 div + p { background-color: yellow;}

B.

 div,  p { background-color: yellow;}

C.

 div ~ p { background-color: yellow;}

D.

 div > p { background-color: yellow;}

 

9.

After executing the following code, what will be produced?

function square(x) {return x * x};

console.log(square(4, true, "hedgehog"));

A.

Error: try to pass more parameters when one is expected

B.

hedgehog

C.

true

D.

16

 

10.

Which of the following is the most appropriate check if the variable "a" is not equal the "NULL":?

A.

if (a !=== null)

B.

if (!a == null)

C.

if (a != null)

D.

if (!(a === null))

 

11.

To cater for people with colorblindness, it is suggested that different________ should be used instead of different ________ on multiple lines in a graph.

i. shapes, colors

ii. colors, shapes

iii. grays-scales, shapes

iv. shapes, gray-scales

A.

i and iii

B.

ii, iii and iv

C.

i, ii and iv

D.

i and iv

 

12.

For web accessibility, a/an __________ document should be firstly converted to a/an__________ document by using OCR before it is converted to a PDF document.

A.

avif-based, tiff-based

B.

tiff-based, text-based

C.

text-based, jpg-based

D.

gif-based, avif-based

 

13.

What is the purpose of the following jQuery function?

$("p").after("<p>Hello world!</p>");

A.

Insert <p> element after every "<p>Hello world!</p>".

B.

Insert <p> element after the first "<p>Hello world!</p>"

C.

Insert "<p>Hello world!</p>" after the first <p> element.

D.

Insert "<p>Hello world!</p>" after every <p> element.

Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

4.

In a table, the CSS __________ property can be used to specify the amount of space between the borders of each cell.

A.

border-padding

B.

spacing

C.

padding

D.

border-spacing

 

5.

Which of the following statements is TRUE about using a router instead of a switch for connecting a host computer to Internet?

A.

A router can normally do what a switch can do but not necessarily the reverse.

B.

A switch can provide some level of filtering and thus some level of security.

C.

Both router and switch work on data link layer.

D.

A router provides higher bandwidth than a switch.

 

6.

Which of the following Date objects can be used to set a JavaScript cookie to last for 10 minutes?

A.

now=new Date( ); now.setTime(now.getTime( ) + 1000 * 60 * 10);

B.

now=new Date( ); now.setTime(now.getSystemTime( ) + 1000 * 60 * 10);

C.

now=new Date( ); now.getTime(now.setTime( ) + 1000 * 60 * 10);

D.

now=new Date( ); now.setSystemTime(now.getTime( ) + 1000 * 60 * 10);

 

7.

Which of the following options can be used as hexadecimal literal prefixes?

i.  00

ii. 0x

iii. 0X

iv. 0e

A.

i. and ii.

B.

iii. and iv.

C.

ii. and iii.

D.

i. and iv.

 

8.

Based on the HTML code shown below,  which of the following CSS definitions can turn only the <p> element before the last yellow?

<!DOCTYPE html>

<html>

<head>

<style>

      /* Give correct CSS rule here */

</style>

</head>

<body>

<h1>Welcome to My Homepage</h1>

<div>

  <h2>My name is Donald</h2>

  <p>I live in Duckburg.</p>

</div>

<p>My best friend is Mickey.</p>

<p>I will not be styled.</p>

</body>

</html>

A.

 div + p { background-color: yellow;}

B.

 div,  p { background-color: yellow;}

C.

 div ~ p { background-color: yellow;}

D.

 div > p { background-color: yellow;}

 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning