Hey guys am new to javascript development .i have learned about javascript objects and i have done some code with it ..My code
function afunction() {
var num = 10;
return num;
}
afunction.randomfunction(function() {
return {
"name": "somename"
"age": 12
}
})
When i called the function with afunction.randomfunction.name;
it gives me error like
" underfined is not a function"
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 afunction.randomfunction.name;
i know am doing something wrong ..Hope you guys can help me .to find out my mistake.