global-var.js
来自「这是《JavaScript学习源代码》一书的源代码」· JavaScript 代码 · 共 19 行
JS
19 行
// create a global variable
var stored_num;
// a function to call a second function
// and display a returned result
function call_alert( num )
{
stored_num = num;
make_triple();
alert( "The Value Is " + stored_num );
}
// a function to double a value
// and return the result to the caller
function make_triple()
{
stored_num = stored_num + stored_num + stored_num;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?