What is a function?
What is a block of code that does something when called?
Why do we use functions in code?
What is to reuse code and keep it organized?
What color are function blocks in Scratch?
What is dark purple?
What’s wrong with this? function hello() console.log("Hi")
What is missing the curly braces {}?
Write a function that says “Hello, Ninja!”
What is:
function sayHello() {
console.log("Hello, Ninja!");
}
What keyword do you use to make a function in JavaScript?
What is function?
What happens when we "call" a function?
What is the code inside the function runs?
What does the "define" block do in Scratch?
What is it creates your own custom block (function)?
What happens if you forget to call a function?
What is nothing! The code won’t run.
What function would you make to draw a square in Scratch?
What is a custom block with 4 move + turn steps?
True or False: A function must have a name.
What is true?
True or False: You can call a function as many times as you want.
What is true?
What do you call a function you make yourself in Scratch?
What is a custom block?
Can you use a function before it's created?
What is sometimes, depending on the language?
Name a function you could use in a video game.
What is checkCollision(), updateScore(), or playSound()?
What do we call the inputs of a function?
What are parameters?
What is a function that returns something?
What is a function that gives back a value?
Can Scratch functions have parameters (inputs)?
What is yes!
Find the bug:
function greet(name) {
console.log("Hello, " + Name);
}
What is "Name" should be "name" (case-sensitive)?
Create a function that adds two numbers.
What is:
function add(x, y) {
return x + y;
}
Fill in the blank: function greet() { ________ }
What is the code that runs, like console.log("Hello!")?
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?
In Scratch, what block runs your custom function?
What is the block with your function’s name?
Why does this not work?
function jump() {
console.log("Jump!");
}
jump;
What is it should be jump(); with parentheses?
You’re building a ninja training simulator. What functions might you need?
What is trainNinja(), showScore(), startGame(), etc.?