Variable "is Not Defined" Error, Why September 30, 2023 Post a Comment I have defined a object in a js file: myobj.js MyObj={ test: { value: {a: 10, b: 7}, startTest: function(){ var x = this.value.a; var y = this.valueSolution 1: mytest = MyObj.test.startTestThis gives you a function without context. If you call this function directly then this is window.You want to all test.startTest() so that this is testAn excellent guide on this Share Post a Comment for "Variable "is Not Defined" Error, Why"
Post a Comment for "Variable "is Not Defined" Error, Why"