title: How do i call a function on another function
body: <p>I am trying to call a function does multiplication On another function that accepts two numbers as parameters. i Have tried using constructor and nested function, but to no avail.  i have tried the followings:</p>
  
  <pre><code>function Coordinate(a, b) {
      var x, y;
      return {x: a, y: b};
      function multiply(n) {
         x * n;
         y * n;
      }
  }
  var makeCoordinate = new Coordinate(2,3);
  console.log(makeCoordinate.multiple(2));
  </code></pre>
  
  <p>// expected output: 4 6;</p>