Nascent Personality Manifestation
Wondering what’s next for npm?Check out our public roadmap! »

@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

Install

npm i @pelevesque/find-nearest-number

DownloadsWeekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

4.65 kB

Total Files

6

Last publish

Collaborators

  • avatar