@@ -164,9 +164,9 @@ tape( 'the method returns `false` if one or more elements fail a test', function
164164} ) ;
165165
166166tape ( 'the method returns `false` on first element that fails the test' , function test ( t ) {
167+ var count ;
167168 var bool ;
168169 var q ;
169- var count ;
170170
171171 q = new FIFO ( ) ;
172172 q . push ( 2 ) ;
@@ -215,9 +215,9 @@ tape( 'the method supports providing an execution context', function test( t ) {
215215} ) ;
216216
217217tape ( 'the method provides the element value, index, and queue as arguments to the predicate' , function test ( t ) {
218- var q ;
219218 var indices ;
220219 var values ;
220+ var q ;
221221
222222 q = new FIFO ( ) ;
223223 q . push ( 'a' ) ;
@@ -251,9 +251,7 @@ tape( 'the method works with different data types', function test( t ) {
251251 q . push ( 1 ) ;
252252 q . push ( 2 ) ;
253253
254- bool = q . every ( function ( v ) {
255- return typeof v === 'number' ;
256- } ) ;
254+ bool = q . every ( predicate ) ;
257255
258256 t . strictEqual ( bool , true , 'works with numbers' ) ;
259257
@@ -262,9 +260,7 @@ tape( 'the method works with different data types', function test( t ) {
262260 q . push ( 'bar' ) ;
263261 q . push ( 'baz' ) ;
264262
265- bool = q . every ( function ( v ) {
266- return typeof v === 'string' ;
267- } ) ;
263+ bool = q . every ( predicate ) ;
268264
269265 t . strictEqual ( bool , true , 'works with strings' ) ;
270266
@@ -273,11 +269,12 @@ tape( 'the method works with different data types', function test( t ) {
273269 q . push ( false ) ;
274270 q . push ( true ) ;
275271
276- bool = q . every ( function ( v ) {
277- return typeof v === 'boolean' ;
278- } ) ;
272+ bool = q . every ( predicate ) ;
279273
280274 t . strictEqual ( bool , true , 'works with booleans' ) ;
281-
282275 t . end ( ) ;
276+
277+ function predicate ( v ) {
278+ return v !== void 0 ;
279+ }
283280} ) ;
0 commit comments