half
的参数进行解构赋值,使得仅仅将max
与min
的值传进函数。
stats
的类型应该是一个object
。
testString: assert(typeof stats === 'object');
- text: half(stats)
应该等于28.015
testString: assert(half(stats) === 28.015);
- text: 应该使用解构赋值。
testString: assert(code.replace(/\s/g, '').match(/half=\({\w+,\w+}\)/));
- text: 应该使用解构参数。
testString: assert(!code.match(/stats\.max|stats\.min/));
```