最佳答案
我试图在 Node.js 模块的一个 Arrow 函数中使用 isNaN
全局函数,但是我得到了这个错误:
[eslint] Unexpected use of 'isNaN'. (no-restricted-globals)
这是我的暗号:
const isNumber = value => !isNaN(parseFloat(value));
module.exports = {
isNumber,
};
知道我哪里做错了吗?
附注: 我使用的是 AirBnB 风格指南。