如何调用另一个函数内的函数?
16lz
2021-01-22
I just want to know how to call a javascript function inside another function. so if I have the code below, how do I call the second function inside the first?
我只想知道如何在另一个函数中调用javascript函数。所以,如果我有下面的代码,我如何调用第一个函数?
function function_one()
{
alert("The function called 'function_one' has been called.")
//Here I would like to call function_two.
}
function function_two()
{
alert("The function called 'function_two' has been called.")
}
3 个解决方案
#1
83
function function_one() {
function_two(); // considering the next alert, I figured you wanted to call function_two first
alert("The function called 'function_one' has been called.");
}
function function_two() {
alert("The function called 'function_two' has been called.");
}
function_one();
更多相关文章
- 如何使函数等到对象的值未定义为js setTimeout
- 放在和中的javascript语句,但是语句不在函数中,这些语句何在被执行
- res.jwt不是函数 - NodeJS Express
- Javascript中的素数函数...多个语句
- touchableopacity onpress函数undefined(不是函数)React Native
- 运行一次后停止执行函数
- Javascript日期/时间函数是否依赖于客户端机器?
- 是否可以从节点js中的同一模块导出构造函数和一些正常函数?
- javaES6箭头函数的全新特性