Skip to content

Files

Latest commit

 

History

History
23 lines (17 loc) · 433 Bytes

no-useless-undefined.md

File metadata and controls

23 lines (17 loc) · 433 Bytes

Pattern: Explicit undefined assignment

Issue: -

Description

Variables, parameters, and return statements are undefined by default, making explicit assignments of undefined unnecessary and verbose.

Examples

Example of incorrect code:

let foo = undefined;
const bar = (x = undefined) => {};
return undefined;

Example of correct code:

let foo;
const bar = (x) => {};
return;