title: Function producing undefined variable
body: <p>I am working within a Learning Management System and creating some custom components</p>
  
  <p>This is returning the url but the "course_syllabus_code" shows up as undefined after the url. I am a beginner to Javascript and have looked at some of the other answers on Google but still cannot figure it out.</p>
  
  <p>Basically the user will be able to open the code and enter the Variables(There will be multiple) at the top. Then further below is where all the magic is supposed to happen...</p>
  
  <p>The structure of the variable being entered cannot change but maybe the "magic" isn't being executed in the best way possible.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var course_syllabus_code = "72524";
  
  function syllabusLink(course_syllabus_code) {
  location.href = 'https://foo.com'+course_syllabus_code;
  }
  &lt;/script&gt;
  
  &lt;ul&gt;
  &lt;li&gt;&lt;a href="javascript:syllabusLink()"&gt;&lt;img src="CourseButton3.png" /&gt;Syllabus&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>