Permalink
Browse files

Use `id && (js.id = id);` instead of `js.id = id || null`.

  • Loading branch information...
1 parent 35734fe commit 364f4d10ac8668a922d56cd12f7542a40e033661 @mathiasbynens mathiasbynens committed Oct 20, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 async-script-loading/async-script-loading.js
@@ -14,10 +14,10 @@
fjs = doc.getElementsByTagName(script)[0],
frag = doc.createDocumentFragment(),
add = function(url, id) {
- if (doc.getElementById(id)) {return;}
+ if (doc.getElementById(id)) { return; }
js = doc.createElement(script);
js.src = url;
- js.id = id || null;
+ id && (js.id = id);
frag.appendChild(js);
};

0 comments on commit 364f4d1

Please sign in to comment.