Hopefully, this is a simple answer. I am trying to call a method from inside my object, however, the console is throwing an error that the function is not a function.
function tabs(el, data){
this.el = el;
this.addTab = function(data){
console.log("addTab", this.el, data);
};
data.forEach(function(data){
this.addTab(data);
});
}
I am calling my object initially like so:
var t = new tabs("tabs", []);
My error is that addTab is not a function.