Skip to content

Instantly share code, notes, and snippets.

@MarsiBarsi
Created August 6, 2021 05:41
Show Gist options
  • Save MarsiBarsi/1edbd8072c688a4957f8032dc22b8744 to your computer and use it in GitHub Desktop.
Save MarsiBarsi/1edbd8072c688a4957f8032dc22b8744 to your computer and use it in GitHub Desktop.
function expandObjWithStatus(obj, condition) {
return {
...obj,
...(condition && {
status: 'modified'
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment