# freeCodeCamp Challenge Guide: Test if a Value is an Array

**URL:** <https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-test-if-a-value-is-an-array/301600>\
**Category:** freeCodeCamp Contributors\
**Tags:** guide\
**Created:** [August 3, 2019, 1:22pm UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-test-if-a-value-is-an-array/301600 "2019-08-03T13:22:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![camperbot](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camperbot/32/18364_2.png) [@camperbot](https://forum.freecodecamp.org/u/camperbot)\
**Post date:** [August 3, 2019, 1:22pm UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-test-if-a-value-is-an-array/301600/1 "2019-08-03T13:22:20Z")

</div>

# [Test if a Value is an Array](https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array)

* * *

## Problem Explanation

To begin, locate the file “tests/1\_unit\_tests.js” and scroll to the suite of tests for ‘Arrays’.

This file contains multiple suites of tests for the project, and this challenge requires you to make the tests in ` /** 11 */` pass.

* * *

## Hints

### Hint 1

The lines in the test should be changed from `assert.fail()` to either `assert.isArray()` or `assert.isNotArray()`.

* * *

## Solutions

> **Solution 1 (Click to Show/Hide)**
>
> ```js
> / **11 - #isArray vs #isNotArray** /
> test('#isArray, #isNotArray', function() {
> assert.isArray(
> 'isThisAnArray?'.split(''),
> 'String.prototype.split() returns an Array'
> );
> assert.isNotArray([1, 2, 3].indexOf(2), 'indexOf returns a number.');
> });
> 
> ```

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 8, 2025, 3:57pm UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-test-if-a-value-is-an-array/301600/2 "2025-01-08T15:57:54Z")

</div>

Closed on January 8, 2025, 3:57pm UTC


