Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
206 changes: 51 additions & 155 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/utils/getArrayMaxValue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Author: Dustin Craven
* Date: 06 June 2026
* File: arrayMaxValue.js
* Description: This script returns the maximum value of an array
*/
'use strict';

// The getArrayMaxValue finds the max value of an array and returns that value
function getArrayMaxValue(arr) {

// If the input is not an array, return an error
if (!Array.isArray(arr)) {
throw new Error('Input value is not an array for getArrayMaxValue');
}

// Get the max value of the array while using a filter to remove all non-numbers and keeping zeros
const maxValue = Math.max(...arr.filter((n) => typeof n === 'number' && Number.isFinite(n)));

return maxValue;
}

module.exports = { getArrayMaxValue }; // Export the getArrayMaxValue function for use in other scripts
Loading