Fixed a few minor bugs with submitting solutions for Coding Contracts. Started on Getting STarted Guide for wiki

This commit is contained in:
danielyxie
2019-02-26 18:26:29 -08:00
committed by danielyxie
parent d54e39c9c6
commit 9879d07d7c
11 changed files with 104 additions and 57 deletions
+8
View File
@@ -0,0 +1,8 @@
// Checks whether an array is a 2D array.
// For this, a 2D array is an array which contains only other arrays.
// If one element in the array is a number or string, it is NOT a 2D array
export function is2DArray(arr: any[]): boolean {
if (arr.constructor !== Array) { return false; }
return arr.every((e) => { return e.constructor === Array; });
}