You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-4Lines changed: 33 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,29 @@ In this project, you will help CamperBot build a random background color changer
114
114
Fix the <code>document.querySelector("bg-hex-code")</code> line so that it correctly selects the element with the <code>id</code> of <code>bg-hex-code</code>.
115
115
</p>
116
116
</details>
117
+
<details>
118
+
<summary>
119
+
<h5>Step 6</h5>
120
+
</summary>
121
+
<p>
122
+
CamperBot has now created a function called <code>changeBackgroundColor</code> that changes the background color of the page to a random color from the <code>darkColorsArr</code> array. The function also displays the hex code for that new color.
123
+
</p>
124
+
<p>
125
+
When they try to test out this function, they notice that the background color is not changing and the text shows the following:
126
+
</p>
127
+
<details>
128
+
<summary>
129
+
<h5>Example Code</h5>
130
+
</summary>
131
+
<code>Hex Code: undefined</code>
132
+
</details>
133
+
<p>
134
+
<code>undefined</code> is showing up here because the <code>color</code> variable is not being set correctly.
135
+
</p>
136
+
<p>
137
+
Fix the error in the <code>darkColorsArr[getRandomIndex]</code> line so that the color variable is set to a random color from the <code>darkColorsArr</code> array.
Copy file name to clipboardExpand all lines: __0__title__/README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,8 +114,32 @@ In this project, you will help CamperBot build a random background color changer
114
114
Fix the <code>document.querySelector("bg-hex-code")</code> line so that it correctly selects the element with the <code>id</code> of <code>bg-hex-code</code>.
115
115
</p>
116
116
</details>
117
+
<details>
118
+
<summary>
119
+
<h5>Step 6</h5>
120
+
</summary>
121
+
<p>
122
+
CamperBot has now created a function called <code>changeBackgroundColor</code> that changes the background color of the page to a random color from the <code>darkColorsArr</code> array. The function also displays the hex code for that new color.
123
+
</p>
124
+
<p>
125
+
When they try to test out this function, they notice that the background color is not changing and the text shows the following:
126
+
</p>
127
+
<details>
128
+
<summary>
129
+
<h5>Example Code</h5>
130
+
</summary>
131
+
<code>Hex Code: undefined</code>
132
+
</details>
133
+
<p>
134
+
<code>undefined</code> is showing up here because the <code>color</code> variable is not being set correctly.
135
+
</p>
136
+
<p>
137
+
Fix the error in the <code>darkColorsArr[getRandomIndex]</code> line so that the color variable is set to a random color from the <code>darkColorsArr</code> array.
0 commit comments