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

using destructuring on arrays #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

//Object Array to hold quotes, sources, citaitons and years
var quotes = [
const quotes = [
{
quote: "Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.",
source: "Dr. Seuss"
Expand Down Expand Up @@ -172,10 +172,10 @@ function getRandomQuote () {

//Function to select random rgb color value
function getRandomColor () {
var red = Math.floor(Math.random() * 256 );
var green = Math.floor(Math.random() * 256 );
var blue = Math.floor(Math.random() * 256 );
var randomColor = 'rgb(' + red + ',' + green + ',' + blue + ')';
var [red, green, blue] = [Math.random() * 256, Math.random() * 256, Math.random() * 256 ];


var randomColor = 'rgb(' + Math.floor(red) + ',' + Math.floor(green) + ',' + Math.floor(blue) + ')';
return randomColor;
}

Expand Down