Skip to content

Instantly share code, notes, and snippets.

@MQuy
Created May 12, 2017 20:21
Show Gist options
  • Select an option

  • Save MQuy/f03bd3b0431e39598404fb818e0579d3 to your computer and use it in GitHub Desktop.

Select an option

Save MQuy/f03bd3b0431e39598404fb818e0579d3 to your computer and use it in GitHub Desktop.
assets = ['vendor.js', 'app.js'];
if (!("fetch" in window && "Promise" in window)) {
assets.unshift('polyfill.js');
}
scripts.forEach(function(src) {
var scriptEl = document.createElement('script');
scriptEl.src = src;
scriptEl.async = false;
document.head.appendChild(scriptEl);
});
@titanve

titanve commented May 13, 2017

Copy link
Copy Markdown

Shouldn't it be assets.forEach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment