Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bubblxs/is-even
is even?
https://github.com/bubblxs/is-even
c javascript npm-package npmjs
Last synced: 19 days ago
JSON representation
is even?
- Host: GitHub
- URL: https://github.com/bubblxs/is-even
- Owner: bubblxs
- Created: 2024-12-03T01:03:27.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2024-12-05T15:36:35.000Z (19 days ago)
- Last Synced: 2024-12-05T16:33:58.060Z (19 days ago)
- Topics: c, javascript, npm-package, npmjs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/is_even_ee
- Size: 7.34 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
is even?
> js lib to check if a given number is even. just like the others libs but better. why? because i made it.
### install
```
npm i is_even_ee
```### usage
```js
import "is_even_ee";const is_even = (1).isEven();
console.log(is_even); // => false;
```### benchmark
#### using the "right way" to check if a number is even. 🤢🤮🤮😖
```js
const isEven = (num) => num % 2 === 0;const start = Date.now();
const is_even = isEven(1);
const finish = Date.now();console.log(is_even); // => false;
console.log((finish - start) / 1000); // => 0.001s
```#### using the coolest way. 😎😎😎🤑
```js
import "./is_even_ee";const start = Date.now();
const is_even = (1).isEven();
const finish = Date.now();console.log(is_even); // => false;
console.log((finish - start) / 1000); // => 8.028s