lin-123 / javascript Goto Github PK
View Code? Open in Web Editor NEWThis project forked from airbnb/javascript
eslint-config-airbnb 中文版
Home Page: https://lin-123.github.io/javascript/
License: MIT License
This project forked from airbnb/javascript
eslint-config-airbnb 中文版
Home Page: https://lin-123.github.io/javascript/
License: MIT License
5.3 翻译有误
英文原文L“5.3 Use object destructuring for multiple return values, not array destructuring.”
您翻译成“多个返回值用对象的解构,而不是数据解构。”
“array destructuring” 应该翻译成“数组解构”。
首长这样警告我们。 这句话啥意思?
3.7对象验证属性中使用了has包,
根据测试,has.call(object,key)
不能正确使用,
应当按照npm包库中作者的要求直接使用has(object,key)
进行验证。
// good
const reaction = "No! That’s impossible!";
(async function meanwhileOnTheFalcon() {
// handle `leia`, `lando`, `chewie`, `r2`, `c3p0`
// ...
}());
此处应为单引号
// good
const reaction = 'No! That’s impossible!';
(async function meanwhileOnTheFalcon() {
// handle `leia`, `lando`, `chewie`, `r2`, `c3p0`
// ...
}());
function foo() {}
形式,导致作用域提升,会出现在函数被声明之前就可以使用// 函数调用出现在函数定义之前,当代码行数比较多时,定位函数比较不方便,不利于从上到下阅读代码的习惯
doSomething();
function doSomething() {
// ...
}
// 推荐如下形式
const doSomething = function() {
// ...
};
doSomething();
// doSomething.js
// 报错信息只会定位到这个文件, 不会提示名称
export default () => {
console.log('匿名函数');
throw new Error('匿名函数');
}
// main.js
import doSomething from './doSomething';
doSomething();
// 命名函数报错
export default function namedFunction() {
console.log('命名函数');
throw new Error('命名函数');
}
Destructuring 一章的 5.1 中
英文原本是**“Why? Destructuring saves you from creating temporary references for those properties.”**,
您翻译为“Why? 解构保存了这些属性的临时值/引用”,
个人认为应当翻译为“Why?因为解构使您不必为这些属性创建临时引用。”
个人愚见。
”
19.16 计算属性内要空格。这里说的是不要加空格吧
字符串6.4那里笔误,应该是永远不要eval
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.