AP Computer Science Principles Pre-Test

AP Computer Science Principles Pre-Test

10th Grade

30 Qs

quiz-placeholder

Similar activities

Ujian MID Informatika Semester Genap 2024-2025

Ujian MID Informatika Semester Genap 2024-2025

10th Grade

25 Qs

bilan année seconde

bilan année seconde

9th - 12th Grade

27 Qs

Role of Banks Quiz

Role of Banks Quiz

10th Grade

25 Qs

Computer Hardware Quiz

Computer Hardware Quiz

9th - 12th Grade

35 Qs

Advanced Python Assessment

Advanced Python Assessment

9th - 12th Grade

30 Qs

Micro:bit Programming Quiz

Micro:bit Programming Quiz

9th - 12th Grade

30 Qs

Quiz JavaScript

Quiz JavaScript

9th - 12th Grade

25 Qs

AP CSP Unit 1 Exam

AP CSP Unit 1 Exam

10th Grade

31 Qs

AP Computer Science Principles Pre-Test

AP Computer Science Principles Pre-Test

Assessment

Quiz

Information Technology (IT)

10th Grade

Medium

Created by

Ethan Batres

Used 4+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to declare a variable in JavaScript?

`var myVariable;`

`variable myVariable;`

`declare myVariable;`

`int myVariable;`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

var x = 5;

var y = 10;

console.log(x + y);

15

510

5

10

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a function declaration in JavaScript?

`function myFunction() {}`

`let myFunction = function() {}`

`const myFunction = () => {}`

`myFunction() = function() {}`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a variable declared with `var` inside a function?

Global

Local to the function

Local to the block

Local to the script

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code:

function add(a, b) {

return a + b;

}

What will `add(3, 4)` return?

34

7

12

undefined

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to create a list (array) in JavaScript?

`var myList = {};`

`var myList = [];`

`let myList = ();`

`let myList = <>;`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

var fruits = ['apple', 'banana', 'cherry'];

console.log(fruits[1]);

apple

banana

cherry

undefined

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?