const func = (() => {
const init = (data) => {
organizeData(data);
return this;
}
const otherFunc = () => {
//Do something else
}
return {
init:init,
otherFunc: otherFunc
}
})();
func.init(data).otherFunc()
I have an issue with the "this" in my init function. It refers to the window instead of my func object.
it returns func.init(data).otherFunc() is not a function because it points to the window instead of my func
Thanks in advance