JavaScript Coding for Kids Flashcards
7 cards from real Online Coding Lessons practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 JavaScript Coding for Kids flashcards as text
What is a function in JavaScript?
Answer: A reusable block of code
A function groups code so you can run it again and again.
How do you run a function named sayHi?
Answer: sayHi()
You call a function by writing its name followed by parentheses.
What goes inside the parentheses when you create a function?
Answer: Parameters (inputs)
Parameters are the inputs a function can use when it runs.
What does the return keyword do in a function?
Answer: Sends a value back out
The return keyword gives a result back from the function.
Why are functions helpful when coding a game?
Answer: They let you reuse code easily
Functions let you reuse the same actions, like jumping, many times.
Which is a correct way to define a simple function?
Answer: function greet() { }
A function starts with the word function, a name, parentheses, and braces.
What is a variable that is created inside a function called?
Answer: A local variable
A local variable only works inside the function where it was made.