npm

Need private packages and team management tools?Check out npm Orgs. »

@pelevesque/find-nearest-number

0.0.3 • 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

Standard Style & Unit Tests

npm test

Unit Tests & Coverage

npm run cover

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

3

version

0.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability