Skip to content

Instantly share code, notes, and snippets.

View ronaldroe's full-sized avatar

Ronald Roe ronaldroe

View GitHub Profile
@ronaldroe
ronaldroe / flatten-test.js
Last active December 13, 2023 15:27
Array Flatten
// This test takes an array, loops through each top level index
// and logs an error if the index contains an array.
// Passes are tallied, and passes/fails are output at the end of the test.
const flattenTest = arr => {
// Define error message and initialize pass counter
const errorMessage = ind => `Index ${ind} contains an array`;
let passCount = 0;