Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
320 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var isArray = require('./');
|
---|
| 2 | var test = require('tape');
|
---|
| 3 |
|
---|
| 4 | test('is array', function(t){
|
---|
| 5 | t.ok(isArray([]));
|
---|
| 6 | t.notOk(isArray({}));
|
---|
| 7 | t.notOk(isArray(null));
|
---|
| 8 | t.notOk(isArray(false));
|
---|
| 9 |
|
---|
| 10 | var obj = {};
|
---|
| 11 | obj[0] = true;
|
---|
| 12 | t.notOk(isArray(obj));
|
---|
| 13 |
|
---|
| 14 | var arr = [];
|
---|
| 15 | arr.foo = 'bar';
|
---|
| 16 | t.ok(isArray(arr));
|
---|
| 17 |
|
---|
| 18 | t.end();
|
---|
| 19 | });
|
---|
| 20 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.