Full Stack LAMP - MEAN Developer, Python developer. Certified Azure Developer. Freelance programmer/consultant/trainer.

JavaScript – Logical assignment operators

Logical assignment operators are new compound assignment operators that combine the logical operations &&, ||, or ?? with assignment

x &&= y;
// Roughly equivalent to x && (x = y)
x ||= y;
// Roughly equivalent to x || (x = y)
x ??= y;
// Roughly equivalent to x ?? (x = y)

Note that, unlike mathematical and bitwise compound assignment operators, logical assignment operators only conditionally perform the assignment.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments