AP Computer Science Principles Pre-Test

AP Computer Science Principles Pre-Test

Assessment

Flashcard

Information Technology (IT)

10th Grade

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

28 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following is a valid way to declare a variable in JavaScript?
Options: `var myVariable;`, `variable myVariable;`, `declare myVariable;`, `int myVariable;`

Back

`var myVariable;`

2.

FLASHCARD QUESTION

Front

What will be the output of the following code snippet? var x = 5; var y = 10; console.log(x + y);

Back

15

3.

FLASHCARD QUESTION

Front

Which of the following is a function declaration in JavaScript?
Options: `function myFunction() {}` , `let myFunction = function() {}` , `const myFunction = () => {}` , `myFunction() = function() {}`

Back

`function myFunction() {}`

4.

FLASHCARD QUESTION

Front

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

Back

Local to the function

5.

FLASHCARD QUESTION

Front

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

Back

7

6.

FLASHCARD QUESTION

Front

Which of the following is a valid way to create a list (array) in JavaScript? Options: `var myList = {};`, `var myList = [];`, `let myList = ();`, `let myList = <>;`

Back

`var myList = [];`

7.

FLASHCARD QUESTION

Front

What will be the output of the following code?
var fruits = ['apple', 'banana', 'cherry'];
console.log(fruits[1]);

Back

banana

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?

Discover more resources for Information Technology (IT)