Please enable JavaScript to use CodeHS

Introduction to Computer Science (Collie) (2022)

Description

In this lesson, students learn about functions and parameters in the context of JavaScript, which builds on their prior knowledge of working with functions in Karel. This lesson focuses specifically on defining and calling functions, and passing simple, single parameters to functions.

Objective

Students will be able to…

  • Explain the purpose of functions
  • Create JavaScript functions
  • Utilize JavaScript functions to solve simple problems
  • Create functions that take in parameters as input
Description

In this lesson, students will work with, define and call their own functions that take in multiple parameters as input and print out output.

Objective

Students will be able to:

  • Explain the purpose of functions
  • Create JavaScript functions
  • Utilize JavaScript functions to solve simple problems
  • Create functions that take in multiple parameters as input, and use print statements for output
Description

In this lesson, students continue working with multiple parameters that create graphics as output which is very useful, since creating several different graphical objects involves writing the same code over and over again (set the size, set the color, set the location, etc).

Objective

Students will be able to:

  • Explain the purpose of functions
  • Create JavaScript functions
  • Utilize JavaScript functions to simplify graphics programs
  • Identify repeated code that can be simplified with functions and parameters
  • Create functions that take in multiple parameters as input, and create graphics as output
Description

In this lesson, students learn about return values so they can write functions that do some work and send the result back or use later in the program.

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 store the result for later use.
Description

In this lesson, students work with and define functions with return values and more than one parameter.

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.
Description

In this lesson, students will explore the scoping of a variable, which is where the variable is “defined” or where it exists.

Objective

Students will be able to:

  • Identify the scope of a variable
  • Identify which variables are in scope at a given point in a program
Description

In this lesson, students review content with a 15 question Unit Quiz.

Objective

Students will be able to:

  • Prove their knowledge of functions and parameters through a multiple choice quiz