DEV Community

Cover image for javaScript newbies, I have a challenge for you!
Piko
Piko

Posted on

javaScript newbies, I have a challenge for you!

As a beginner or someone learning programming, it can be overwhelming to start working on solo projects. However, like anything complex, it helps to take baby steps.

For example, after you learn something new you could try to figure out a way to apply what you have learned. You do not have to create anything massive or huge. Creating something small but has a clear purpose can be a greateway to get your feet wet.

Okay, but how do I find ideas on what to create?

Every invention starts with an idea, and every idea starts with a question. So every time you learn something new try to ask yourself something like:
“How can I use this to create something with purpose?”
“Do I know of a problem that this can help solve?”

It also helps to try and stop after learning something new, and see how you could use that with the things you have already learned. For example, I wrote an RGB color generator function a while back, I was still in my early coding days. It started with me asking myself “ if the RGB model consists of different values of the colors Red, Blue, and Green. Can I just make a function that relies on the Math.random method to generate different colors, by generating a random integer value of each color component?”

It was at a time, when I felt I knew all the concepts that would allow me to create a function like that, but I still lacked the confidence. However, I pushed myself and I did it, and it was only possible because I broke down the problem into simple TODOs.

Here is your Challenge!

If you are someone who is new to coding and is looking for a challenge to help you slowly breakout of tutorial hell, and start creating your own project. I challenge you to try and create an RGB color generator function. I made a code pen - You'll find it below complete with all the extra code required, and all you have to do it complete the function.

The concepts you should be familiar with to complete the challenge:

  • Defining a function
  • Declaring variables: We declare a variable to hold the values of - The RGB color format
  • Math.random method

To try the challenge just complete the colorGen function in the JS section:

Spend at least half an hour trying, and after that if you feel completely at loss. You could watch this short tutorial to help you out:

Best of luck!

Top comments (7)

Collapse
 
lnahrf profile image
Lev N.

I like the format of this post, not a beginner but these challenge posts can bring tremendous value to beginners (or even advanced coders).
Mind if I write one of these challenges myself? I will credit you for the concept.

Collapse
 
piko profile image
Piko

Of course you can! I can't wait to see the challenge you will create!

Thank you for writing this comment and offering to credit me. I really appreciate it!

Collapse
 
lnahrf profile image
Lev N.

Thanks, I will tag you when I post it :)

Collapse
 
kaamkiya profile image
Kaamkiya

Awesome post! The first time I tried this (a long time ago) I had no clue how. Now, though, I can do it in seconds! To any newbies out there, you can do it!

Collapse
 
piko profile image
Piko

Super impressive! Congratulations, sounds like you have made so much progress!

I am so glad you liked the post. Thank you for your comment and kind words.

Collapse
 
sharmi2020 profile image
Sharmila kannan

nice coding challenge!!!

Collapse
 
piko profile image
Piko

Thank you, Sharmila! Glad you like it. 😍