Hi,
See below code to be reviewed please - much appreciated!
Functions: Task 1
p {
color: purple;
margin: 0.5em 0;
}
* {
box-sizing: border-box;
}
</style>
<link rel="stylesheet" href="../styles.css" />
<section class="preview">
<div id='p'></div>
</section>
Hi @keifer2!
I’d be happy to assess your code, but I can’t assess the following; most of it seems to be missing. Can you put your working code into an online code editor like codepen, or glitch, or jsfiddle, then send me the link?
thanks for the reply @chrisdavidmills
Ah, it didn’t paste the whole code!
I use VSCode - don’t know if i can share from there but i’ve set up Codepen anyway and hopefully you’ll find this link takes you to it.
https://codepen.io/Keifer2/pen/bGVVOrm
thanks.
Hi @keifer2 - this kinda works OK. The main thing I’d say here is that the random function is not very flexible. It is better to pass it min and max parameters so that you can get it to return a random number in any range, not just a fixed range.
See our solution here: https://github.com/mdn/learning-area/blob/master/javascript/building-blocks/tasks/functions/marking.md#task-3
i see what you mean - your solution does look much simpler.
thanks for the feedback.