@pelevesque/find-nearest-number

0.0.4 • Public • Published

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

Command Description
npm test or npm run test All Tests Below
npm run cover Standard Style
npm run standard Coverage
npm run unit Unit 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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i @pelevesque/find-nearest-number

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

4.65 kB

Total Files

6

Last publish

Collaborators

  • pelevesque