Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/plugin-proposal-logical-assignment-operators

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-logical-assignment-operators

Transforms logical assignment operators into short-circuited assignments

  • 7.12.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.3M
increased by19.94%
Maintainers
6
Weekly downloads
 
Created

What is @babel/plugin-proposal-logical-assignment-operators?

The @babel/plugin-proposal-logical-assignment-operators package allows Babel to compile logical assignment operators into ES5 or your target environment's JavaScript. Logical assignment operators combine logical operations with assignment expressions, enabling more concise and expressive code.

What are @babel/plugin-proposal-logical-assignment-operators's main functionalities?

Logical AND assignment (&&=)

This feature allows the assignment of the right operand to the left operand only if the left operand is truthy. It's equivalent to `a = a && b;`.

a &&= b;

Logical OR assignment (||=)

This feature enables the assignment of the right operand to the left operand if the left operand is falsy. It simplifies the expression `a = a || b;`.

a ||= b;

Logical nullish assignment (??=)

This feature assigns the right operand to the left operand only if the left operand is null or undefined, making the code `a = a ?? b;` more concise.

a ??= b;

Other packages similar to @babel/plugin-proposal-logical-assignment-operators

Keywords

FAQs

Package last updated on 14 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc