---
id: 69f8c998d78ad3171a0713be
title: "Challenge 291: FizzBuzz Count"
challengeType: 28
dashedName: challenge-291
---

# --description--

Given a start and end number, count the number of fizz and buzz appearances in the range (inclusive).

- Numbers divisible by 3 count as a fizz.
- Numbers divisible by 5 count as a buzz.
- Numbers divisible by both 3 and 5 count as both a fizz and a buzz.

Return an object or dictionary with the counts in the format: `{ fizz, buzz }`.

# --hints--

`fizzBuzzCount(1, 11)` should return `{fizz: 3, buzz: 2}`.

```js
assert.deepEqual(fizzBuzzCount(1, 11), {fizz: 3, buzz: 2});
```

`fizzBuzzCount(14, 41)` should return `{fizz: 9, buzz: 6}`.

```js
assert.deepEqual(fizzBuzzCount(14, 41), {fizz: 9, buzz: 6});
```

`fizzBuzzCount(24, 100)` should return `{fizz: 26, buzz: 16}`.

```js
assert.deepEqual(fizzBuzzCount(24, 100), {fizz: 26, buzz: 16});
```

`fizzBuzzCount(-635, -14)` should return `{fizz: 207, buzz: 125}`.

```js
assert.deepEqual(fizzBuzzCount(-635, -14), {fizz: 207, buzz: 125});
```

`fizzBuzzCount(-5432, 6789)` should return `{fizz: 4074, buzz: 2444}`.

```js
assert.deepEqual(fizzBuzzCount(-5432, 6789), {fizz: 4074, buzz: 2444});
```

# --seed--

## --seed-contents--

```js
function fizzBuzzCount(start, end) {

  return start;
}
```

# --solutions--

```js
function fizzBuzzCount(start, end) {
  let fizz = 0, buzz = 0;

  for (let i = start; i <= end; i++) {
    if (i % 3 === 0) fizz++;
    if (i % 5 === 0) buzz++;
  }

  return { fizz, buzz };
}
```
