Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 257 Bytes

rename-destructered-variables.md

File metadata and controls

9 lines (6 loc) · 257 Bytes

Rename destructured variables in JavaScript

To rename a destructured variable in JavaScript, use a colon to provide the new name.

let { original: newName } = data;

Hat tip to Wes Bos' blog.