JavaScript JavaScript Basics Creating Reusable Code with Functions Passing an Argument to a Function

hunter bougis
hunter bougis
Full Stack JavaScript Techdegree Student 12,316 Points

What am I doing wrong?

it keeps saying it can't find the variable 'soccer' please

function returnValue(sport) { var echo = soccer; return sport; } returnValue(soccer);


  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="script.js"></script>

1 Answer

Two things; 1) inside method, you are returning wrong and undefined variable 2) you are calling method with undefined variable, instead of string

function returnValue(sport) { 
  return sport;