Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
easy Solved by 4 students

Array Processing Function Analysis

Mark
< Prev
Next >

Consider the following code segment.

function processData(data)
{
 let result = [];
 for (let i = 0; i < data.length; i++)
 {
 if (data[i] > 0)
 {
 result.push(data[i] * 2);
 }
 }
 return result;
}

Which of the following best describes the functionality of the processData function?

A

Counts the number of positive values in the array

B

Removes negative values from the original array

C

Doubles all values in the original array

D

Creates a new array with positive values doubled

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1soniahalepota200511 0m 10s 90
#2tianbo.shen11 0m 20s 80
#3my.emma.mei11 0m 47s 53
#4devanshs90512 0m 43s 47
#5proundpimfhao01 0m 00s -10
#6Sushantpr.250601 0m 07s -17
#7spiritgen0201 0m 15s -25
#8batonoltanr01 0m 55s -65
Items per page:
10
1 – 8 of 8

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|