Hey guys am new to javascript and when i tried some piece of code its showing type error ..The code is
var something = function(element){
this.name = "oops";
this.some = function(element) { console.log(this.name); };
element.addEventListner('click', this.some, false);
}
When i called the above function like var b = something("baba"); its showing error TypeError: undefined is not a function..I dunno why it happens like this..
Hope you can help me ..Thanks