---
url: /docs/guide/usage/linter/rules/eslint/no-sequences.md
---

### What it does

Disallows the use of the comma operator.

### Why is this bad?

The comma operator evaluates each of its operands (from left to right)
and returns the value of the last operand. However, this frequently
obscures side effects, and its use is often an accident.

### Examples

Examples of **incorrect** code for this rule:

```javascript
((foo = doSomething()), val);

(0, eval("doSomething();"));

// Arrow function body needs double parentheses
const fn = () => (doSomething(), val);

// with allowInParentheses: false
foo = (doSomething(), val);
```

Examples of **correct** code for this rule:

```javascript
foo = (doSomething(), val);

(0, eval)("doSomething();");

// Single extra parentheses is enough for conditions
do {} while ((doSomething(), !!test));

for (i = 0, j = 10; i < j; i++, j--) {}

// Arrow function body needs double parentheses
const fn = () => (doSomething(), val);
```

## Configuration

This rule accepts a configuration object with the following properties:

### allowInParentheses

type: `boolean`

default: `true`

If this option is set to `false`, this rule disallows the comma operator
even when the expression sequence is explicitly wrapped in parentheses.

## How to use

## Version

This rule was added in v1.33.0.

## References
