I have a javascript file and i'm using closure to create functions:
"use strict";
(function(window) {
var ele = function() {
return {
func3:function(methodToCall){
methodToCall();
},
func1:function() {
this.func2();
},
func2:function() {
}
}
}
window.ele = new ele();
})(window);
As you can see, i'm trying to call func2 from inside func1. The browser barks at me saying "func2 is undefined". I'm calling func1 like so:
<script>
ele.func3(ele.func1());
</script>
How do i call func2 from func1? Thanks