Javascript Check If Array Contains Subarray Problems