title: Using objects with function in javascript
body: <p>Hey guys am new to javascript development .i have learned about javascript objects and i have done some code with it ..My code</p>
  
  <pre><code>function afunction() { 
  var num = 10;
  return num;
  }
  
  afunction.randomfunction(function() {
  
  return {
  
  "name": "somename"
  
  "age": 12
  }
  
  })
  </code></pre>
  
  <p>When i called the function with  <code>afunction.randomfunction.name;</code> it gives me error like</p>
  
  <pre><code>" underfined is not a function"
  </code></pre>
  
  <p>i dont know why am getting like this .what i need is that i need to get the the value of name object by using <code>afunction.randomfunction.name;</code></p>
  
  <p>i know am doing something wrong ..Hope you guys can help me .to find out my mistake.</p>