完整返回语句
填空题 入门
题目
Fill in 空白所以函数返回 square 的 n.
代码
function square(n) {
___ n * n;
}
console.log(square(4)); // 16
提示
keyword 那个发送值 后面到 caller.
解释
返回 keyword 发送值 后面到 caller. 不使用返回, 函数 computes n * n 但 discards result, returning undefined. 使用 返回 n * n;, square(4) 返回 16.
相关资源
相关课程
- 函数
学习如何函数工作 in programming.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。