Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javascript/20210116/1040518332/ #28

Open
utterances-bot opened this issue Mar 19, 2023 · 4 comments
Open

javascript/20210116/1040518332/ #28

utterances-bot opened this issue Mar 19, 2023 · 4 comments

Comments

@utterances-bot
Copy link

JavaScript 核心觀念(46)-函式以及 This 的運作-函式以及 This 的運作 - 課後練習 | 是 Ray 不是 Array

接下來這一章節又來到課後練習。

https://israynotarray.com/javascript/20210116/1040518332/

Copy link

第十題的解釋怪怪的,會跳a is not a function並不是因為記憶體被釋放掉,而是因為function b沒有回傳一個function給a導致的。程式改成下面就可以執行了function a(a) {
console.log(a); // undefined
a();
}

function b(b) {
b();
}

function c(c){
console.log('casper');
}

a(b(c));

Copy link

function a(a) {
console.log(a); // undefined
a();
}

function b(b) {
return b;
}

function c(c){
console.log('casper');
}

a(b(c));

Copy link

//我的意思是改成這個才對,抱歉前面不熟悉語法不小心發出留言
function a(a) {
a();
}

function b(b) {
return b;
}

function c(c){
console.log('casper');
}

a(b(c));

@hsiangfeng
Copy link
Owner

@benjamin5252 非常感謝告知,後來回頭看一下這邊的解釋確實是有錯誤
這邊我也針對這一段有稍微修正哩~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants