javascript - 访问对自己类中的类的引用
问题描述
在下面的代码中,如何访问变量而不在其自己的类User
中明确指定关键字“用户” ?
class User {
say = () => {
// Here, I have to explicitly write "User". Is there
// some javascript trick to get the class reference inside
// its own class without explicitly writing the name?
console.log(User);
}
}
解决方案
推荐阅读
- rule - SonarLint 规则中的“squid:”前缀是什么意思?
- kubernetes - 调用执行器刷新端点时,所有 kubernetes pod 配置都不会刷新
- python - 在熊猫中检查相同的行并有条件地创建新列
- emacs - 如何在 Emacs 25 中将 Cx SPC 本地绑定到 gud 模式
- sql - 在三个连接表中计数
- c# - 远程服务器返回错误:(413) Request Entity Too Large Only in HTTPS
- python - 将 OHLC 分钟数据转换为每日 OHLC 数据的重采样函数输出不正确
- r - 闪亮的包安装
- sql - 使用地理坐标时我无法找到错误的确切原因
- angular - 如何限制输入文本框仅接受 Angular4 中移动设备(android、windows)和网页的数字