今天翻同事代码的时候,看到这样一段。无法理解,问对方,说是照着别的地方写的...也没有给出合理解释
module.exports = {
'GET /api/currentUser' (req, res) {
setTimeout(function () {
res.json(currentUser);
}, 300);
},
};
查看module.exports['GET /api/currentUser']的类型是function.
但是不明白这是什么语法,还望解答.
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
https://developer.mozilla.org...