Function Basics
Why Functions?
Scratch Style
Bug Busters
Crazy Challenges
100

What is a function?

What is a block of code that does something when called?

100

Why do we use functions in code?

What is to reuse code and keep it organized?

100

What color are function blocks in Scratch?

What is dark purple?

100

What’s wrong with this? function hello() console.log("Hi")

What is missing the curly braces {}?

100

Write a function that says “Hello, Ninja!”

What is:

function sayHello() {

  console.log("Hello, Ninja!");

}


200

What keyword do you use to make a function in JavaScript?

What is function?

200

What happens when we "call" a function?

What is the code inside the function runs?

200

What does the "define" block do in Scratch?

What is it creates your own custom block (function)?

200

What happens if you forget to call a function?

What is nothing! The code won’t run.

200

What function would you make to draw a square in Scratch?

What is a custom block with 4 move + turn steps?

300

True or False: A function must have a name.

What is true?

300

True or False: You can call a function as many times as you want.

What is true?

300

What do you call a function you make yourself in Scratch?

What is a custom block?

300

Can you use a function before it's created?

What is sometimes, depending on the language?

300

Name a function you could use in a video game.

What is checkCollision(), updateScore(), or playSound()?

400

What do we call the inputs of a function?

What are parameters?

400

What is a function that returns something?

What is a function that gives back a value?

400

Can Scratch functions have parameters (inputs)?

What is yes!

400

Find the bug: 

function greet(name) {

  console.log("Hello, " + Name);

}

What is "Name" should be "name" (case-sensitive)?

400

Create a function that adds two numbers.

What is: 

function add(x, y) {

  return x + y;

}

500

Fill in the blank: function greet() { ________ }

What is the code that runs, like console.log("Hello!")?

500

Why is it better to use functions than copy-pasting the same code?

What is because it’s easier to fix bugs and make updates?

500

In Scratch, what block runs your custom function?

What is the block with your function’s name?

500

Why does this not work? 

function jump() {

  console.log("Jump!");

}

jump;

What is it should be jump(); with parentheses?

500

You’re building a ninja training simulator. What functions might you need?

What is trainNinja(), showScore(), startGame(), etc.?

M
e
n
u