We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类似
callback && callback(); options = options || {};
甚至混杂一些赋值
someCondition && (a = 1);
这些写法呢?个人觉得上面的写法还是比较方便的,但是下面是不是属于滥用了?
The text was updated successfully, but these errors were encountered:
我也比较倾向于这种写法!
Sorry, something went wrong.
不支持短路,觉得如果确实是个分支语句就写 if 好了,清晰一些。压缩工具也会自动转成短路语句。
@techird 简短的语法不仅可以提高编码速度,也能提高代码可读性,比如有多个地方会用到callback调用,如果每次都写一个if (callback) {callback()},不仅累赘,代码长度也会增加不少
简单的短路无妨,不要超出一个表达式或者嵌套好几层逻辑就好
No branches or pull requests
类似
甚至混杂一些赋值
这些写法呢?个人觉得上面的写法还是比较方便的,但是下面是不是属于滥用了?
The text was updated successfully, but these errors were encountered: