<commit_before># 4loop

*Keep your for loop syntax the same for all different types.
Just pass in your constraints and callback and we will determine best course of action.
<br><br>If you pass in anything with a value(obj, map, arr), you will always get that returned first otherwise it will be the iterator or key. Please see examples below*

## Install

`$ npm install 4loop`

## Use

```js
const fourLoop = require('4loop');

const obj = { foo: 'bar', baz: 'cat' };
const arr = ['foo', 'bar', 'baz', 'cat'];
const arrLength = arr.length;
const mySet = new Set(['foo', 'bar', { baz: 'cats' }]);
const myMap = new Map([['foo', 'bar'], ['baz', 'cats'], ['dogs', undefined]])

fourLoop(obj, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints cat, baz, 1
    }
});

fourLoop(arr, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints bar, bar, 1
    }
});

fourLoop(arrLength, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints 1, 1, 1
    }
});

fourLoop(mySet, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints bar, bar, 1
    }
});

fourLoop(myMap, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints baz, cats, 1
    }
});

```<commit_msg>RB: Update documentation example<commit_after># 4loop

*Keep your for loop syntax the same for all different types.
Just pass in your constraints and callback and we will determine best course of action.
<br><br>If you pass in anything with a value(obj, map, arr), you will always get that returned first otherwise it will be the iterator or key. Please see examples below*

## Install

`$ npm install 4loop`

## Use

```js
const fourLoop = require('4loop');

const obj = { foo: 'bar', baz: 'cat' };
const arr = ['foo', 'bar', 'baz', 'cat'];
const arrLength = arr.length;
const mySet = new Set(['foo', 'bar', { baz: 'cats' }]);
const myMap = new Map([['foo', 'bar'], ['baz', 'cats'], ['dogs', undefined]])

fourLoop(obj, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints cat, baz, 1
    }
});

fourLoop(arr, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints bar, bar, 1
    }
});

fourLoop(arrLength, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints 1, 1, 1
    }
});

fourLoop(mySet, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints bar, bar, 1
    }
});

fourLoop(myMap, (value, key, iterator) => {
    // Do magic here
    if (iterator === 1) {
        console.log(value, key, iterator); // Prints cats, baz, 1
    }
});

```
{'fraction_non_alphanumeric': 0.17259380097879282, 'fraction_numerical': 0.009787928221859706, 'mean_word_length': 3.0555555555555554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1235264', 'n_tokens_mistral': 1037, 'n_tokens_neox': 996, 'n_words': 367}