JavaScript Review 1125

JavaScript Review 1125

Assessment

Flashcard

Computers

9th - 12th Grade

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

4 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which instruction defines a block of code that can be called and run as needed?

Back

function draw() {

2.

FLASHCARD QUESTION

Front

Which conditional statement tests whether the x coordinate has a value higher than 400?

Back

if (x > 400) {

3.

FLASHCARD QUESTION

Front

You are writing JavaScript code to draw a rectangle on the canvas. You write the following code:
ctx.beginPath();
ctx.rect(0,210,480,110);
ctx.fillStyle = "#136d15";
ctx.fill();
The rectangle is not drawn. Which instruction did you forget to include?

Back

ctx.closePath();

4.

FLASHCARD QUESTION

Front

Why do we write functions?

Back

To make our code easier to understand, avoid writing repeated code, and make our code reusable.