Coder Social home page Coder Social logo

is-odd's Introduction

is-odd npm YouTube Channel Subscribers

Return true if the number passed is odd, hopefully...

Install

Install with npm

$ npm install --save @samuelmarina/is-odd

How to use it

var isOdd = require('@samuelmarina/is-odd');

isOdd(1); //true
isOdd(2); //false
isOdd(3); //true
// And so on... just for a little while

About

This is a 100% serious project, and it is made to help the community. I figured it out that people also would like to know when a number is odd, and with the npm package @samuelmarina/is-even it was not completely clear, so I decided to create this one as well. Remember, all this hard work is because I care about the community

Contributing

PLEASE, MAKE A PULL REQUEST SO WE CAN FINISH THIS PROJECT ASAP. Also, give it a star, for the sake of God.

Author

Samuel Mariña AKA Samuel Miller

License

Copyright © 2021, Samuel Mariña. Released under the ISC License.

is-odd's People

Contributors

ataysikuu avatar natyavidhan avatar samuelmarina avatar santhoshunt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

is-odd's Issues

Bruh! You Ded

comeBackToU2ube = "Bruh! Don't destroy Tesla, destroy Youtube"
console.log(`${comeBackToU2ube.length%2!==0}`)

Running the code as isOdd(8349) results in error:

Running the code results in the error:

/home/runner/LemonchiffonWirelessSoftwaresuite/node_modules/@samuelmarina/is-odd/index.js:1
import twoMil from './2mil'
^^^^^^

SyntaxError: Cannot use import statement outside a module

Need option which merges all files into one

I am looking to deploy a NodeJS server on FAT12 storage. I can only have up to about 4,000 files and I'm already very close to the limit due to the many other files from my other Node modules, including is-even. Clearly the fact that this repo has divided its code between 10 total files is a massive issue for my use case and my company. If all the js files were merged into one then I would have just enough room to implement my code.

No Typescript definitions

Can I suggest also:
type oddNumber = twoMilOdd | fourMilOdd | ... etc.
Where:
type twoMilOdd = 1 | 3 | 5 | ... etc.
So isOdd can be a type guard:

function isOdd(value: number): value is oddNumber { ... }

Can't we just even?

The is-even project is amazing, and I was thinking if we could use that package as a dependency to this project (I think you can imagine where this is going).

We can use the isEven function to check if the number is even, if it returns false, it's odd. That way everyone can focus all their manpower on just the is-even project.

Please do correct me if I'm wrong.

Unit tests

Please add unit testing; using your is-even library for checks.

It's this simple:

function isOdd(n) {
n % 2 != 0 ? console.log("Number is odd.") : console.log("Number is even.");
}

isOdd(1) // "Number is odd."
isOdd(2) // "Number is even."

Implement ChatGPT

idk how but i know it'd be useful for my tech startup react nextjs vercel blazingly fast sveltekit project :)

No negative numbers

This is a serious issue and it should be fixed. My company depends on the functionality of this package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.