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
将所有的条件置于一个对象或数组中,变为属性的选取操作。
const foo = v => { if (v === 'name') { return 'bao' } else if (v === 'age') { return '18' } else if (v === 'height') { return '180' } } const cfg = { name: 'bao', age: '18', height: '180' } const foo = v => cfg[v] // 数组配置法 if (value === 'hello' || value === 'world' || value === 'blabla') { // ... } // 配置数组形式 const rightValue = ['hello', 'world', 'blabla'] if (rightValue.includes[value]) { // ... }
探索两种优雅的表单验证
The text was updated successfully, but these errors were encountered:
No branches or pull requests
将所有的条件置于一个对象或数组中,变为属性的选取操作。
探索两种优雅的表单验证
The text was updated successfully, but these errors were encountered: