Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use another compound assignment statement #170

Open
elfring opened this issue Dec 15, 2021 · 0 comments
Open

Use another compound assignment statement #170

elfring opened this issue Dec 15, 2021 · 0 comments

Comments

@elfring
Copy link

elfring commented Dec 15, 2021

👀 Some source code analysis tools can help to find opportunities for improving software components.
💭 I propose to increase the usage of compound operators accordingly.

diff --git a/togeojson.js b/togeojson.js
index 23ec6cc..f006622 100644
--- a/togeojson.js
+++ b/togeojson.js
@@ -136,7 +136,7 @@ var toGeoJSON = (function() {
             }
             function kmlColor(v) {
                 var color, opacity;
-                v = v || '';
+                v ||= '';
                 if (v.substr(0, 1) === '#') { v = v.substr(1); }
                 if (v.length === 6 || v.length === 3) { color = v; }
                 if (v.length === 8) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant