{ "all": { "prefix": "30s_all", "body": [ "const all = (arr, fn = Boolean) => arr.every(fn);" ], "description": "Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise." }, "allEqual": { "prefix": "30s_allEqual", "body": [ "const allEqual = arr => arr.every(val => val === arr[0]);" ], "description": "Check if all elements in an array are equal." }, "any": { "prefix": "30s_any", "body": [ "const any = (arr, fn = Boolean) => arr.some(fn);" ], "description": "Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise." }, "approximatelyEqual": { "prefix": "30s_approximatelyEqual", "body": [ "const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;" ], "description": "Checks if two numbers are approximately equal to each other." }, "arrayToCSV": { "prefix": "30s_arrayToCSV", "body": [ "const arrayToCSV = (arr, delimiter = ',') =>", " arr.map(v => v.map(x => `\"${x}\"`).join(delimiter)).join('\\n');" ], "description": "Converts a 2D array to a comma-separated values (CSV) string." }, "arrayToHtmlList": { "prefix": "30s_arrayToHtmlList", "body": [ "const arrayToHtmlList = (arr, listID) =>", " (el => (", " (el = document.querySelector('#' + listID)),", " (el.innerHTML += arr.map(item => `