title: javascript how to create function service (constructor)
body: <p>in AngularJs if you invoke service method:</p>
  
  <pre><code>app.service('nameService', function(){
  this.Service = function (){console.log('hello')}
  }
  </code></pre>
  
  <p>then you can use this service (object) :
  nameService.Service()
  so my question is how i can write function that have two arguments(name, function)</p>
  
  <pre><code>function service ( name, function ){
  // how angular declare object with that value of first argument ? 
  }
  </code></pre>
  
  <p>i'm ask how to write function like service(name,fn){} ?</p>