Discussion: Cracking the Color Code
Execute the code to understand the output and gain insights into the logging of the fillStyle property.
We'll cover the following...
Verifying the output
Now, it’s time to execute the code and observe the output.
Understanding the output
What happens here is that we create a temporary HTML canvas, and then we get its 2D context. After that, we set a color for the fillStyle
property. Now, here’s the unexpected part: when we log ctx.fillStyle
...