Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javanile/boor
🐮 Use only if you hate good manners
https://github.com/javanile/boor
boorish foreach functional-programming nodejs statements
Last synced: about 1 month ago
JSON representation
🐮 Use only if you hate good manners
- Host: GitHub
- URL: https://github.com/javanile/boor
- Owner: javanile
- License: mit
- Created: 2018-04-08T12:50:34.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2022-12-30T19:40:32.000Z (about 2 years ago)
- Last Synced: 2024-11-16T01:21:58.987Z (2 months ago)
- Topics: boorish, foreach, functional-programming, nodejs, statements
- Language: JavaScript
- Homepage:
- Size: 79.1 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# boor
**Warning!** This is not a polite library.
### (SYNC) Loop through **Array** items
```js
/**
* Loop through values only
*/
let values = ['Apple', 'Banana', 'Cagaita']foreach(values, (value) => {
console.log('=>', value)
})// Output:
//=> Apple
//=> Banana
//=> Cagaita
``````js
/**
* Loop through key-value pairs
*/
let values = ['Apple', 'Banana', 'Cagaita']foreach(values, (key, value) => {
console.log(key, '=>', value)
})// Output:
//0 => "Apple"
//1 => "Banana"
//2 => "Cagaita"
```### (ASYNC) Loop through **Array** items
```js
/**
* Loop through values only
*/
let values = ['Apple', 'Banana', 'Cagaita']foreach(values, (index, next) => {
console.log('=>', value)
next()
}).then(() => {
console.log('=> --end--')
})// Output:
//=> Apple
//=> Banana
//=> Cagaita
//=> --end--
``````js
/**
* Loop through key-value pairs
*/
let values = ['Apple', 'Banana', 'Cagaita']foreach(values, (key, value) => {
console.log(key, '=>', value)
})// Output:
//0 => "Apple"
//1 => "Banana"
//2 => "Cagaita"
```