$somefunc()"的等价物?-6ren"> $somefunc()"的等价物?-是否可以在 JS 中将函数名称存储为字符串,然后从对象中调用它,就像下面的 PHP 代码一样? $this->$someFunc(); 最佳答案 this[someFunc](); 关于JavaScr-6ren">
gpt4 book ai didi

JavaScript:什么是 PHP 的 "$this->$somefunc()"的等价物?

转载 作者:搜寻专家 更新时间:2023-11-01 04:45:08 25 4
gpt4 key购买 nike

是否可以在 JS 中将函数名称存储为字符串,然后从对象中调用它,就像下面的 PHP 代码一样?

$this->$someFunc();

最佳答案

this[someFunc]();

关于JavaScript:什么是 PHP 的 "$this->$somefunc()"的等价物?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2127830/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com