0.0.4 • Published 4 years ago

@pelevesque/find-nearest-number v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Build Status Coverage Status JavaScript Style Guide

find-nearest-number

Finds the nearest number of a given target number.

Node Repository

https://www.npmjs.com/package/@pelevesque/find-nearest-number

Installation

npm install @pelevesque/find-nearest-number

Tests

CommandDescription
npm test or npm run testAll Tests Below
npm run coverStandard Style
npm run standardCoverage
npm run unitUnit Tests

Usage

const findNearestNumber = require('@pelevesque/find-nearest-number')
const num = 45
const arr = [-100, -50, 0, 50, 100]
const result = findNearestNumber(num, arr)
// result === 50