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

Update background.js #4

Merged
merged 1 commit into from Apr 8, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Update background.js

Use `const` instead of `var`
  • Loading branch information
FlipFloop committed Apr 6, 2020
commit 36c3672e9e2bc2b71cf86bda55c036460cde139a
@@ -1,4 +1,4 @@
//var arrayOfBackgrounds = ['images/stars3.jpg', 'images/london-web33.jpg'];
var arrayOfBackgrounds = ['images/stars4.jpg'];
var choice = Math.floor(Math.random() * arrayOfBackgrounds.length);
//const arrayOfBackgrounds = ['images/stars3.jpg', 'images/london-web33.jpg'];
const arrayOfBackgrounds = ['images/stars4.jpg'];
const choice = Math.floor(Math.random() * arrayOfBackgrounds.length);
document.querySelector('.background').style.backgroundImage = 'url(' + arrayOfBackgrounds[choice] + ')';
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.