Please enable JavaScript to use CodeHS

Video Game Design in JavaScript (2022)

Lesson 2.20 Functions and Return Values 2

Description

Think of a function like assigning a task. A return value is giving you the completed work.
This allows you to write functions that do some work for you and send back the result.
Parameters are like inputs into the function, and the return value is output.


Objective

Students will be able to…

  • Explain the purpose of returning a value from a function.
  • Create functions that return values.
  • Create programs that call functions with return values and use the return values to solve a higher order problem.