通过子函数递归调用方法

时间:2019-05-18 15:44:32

标签: javascript

有一个类addRecursively(),该类具有方法childFunc(),该方法具有子功能(这是正确的词btw吗?)addRecursively(),它依次调用class Test { addRecursively = function (i) { i++; childFunc(); function childFunc(){ if (i==5) { console.log(i); } else { console.log("Not yet"); this.addRecursively(i); // Cannot read property 'addRecursively' of undefined } } } } var testObj = new Test(); testObj.addRecursively(0);

testObj

如何在不明确解决private void tableKeyPressed(java.awt.event.KeyEvent evt) { int keycode = evt.getKeyCode(); if (keycode == KeyEvent.VK_ENTER) { pricetext.setText(Integer.toString(calculatesum())); } } 示例的情况下调用父函数?

0 个答案:

没有答案