function contains(array, value) {
        if (array) {
            for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
                var v = array_1[_i];
                if (v === value) {
                    return true;
                }
            }
        }
        return false;
    }
Iterates through 'array' by index and performs the callback on each element of array until the callback
returns a truthy value, then returns that value.
If no such value is found, the callback is applied to each element of array and undefined is returned.