Member-only story

Duke University — Programming Foundations with JavaScript, HTML and CSS — The Second Week

Brendan Massey
3 min readJun 30, 2018

--

I have just finished the second week of Duke University’s Programming Foundations with JavaScript, HTML and CSS Coursera course. This week focused heavily on using JavaScript to update or alter images. The introduction gave an overview of what a pixel was, why computers are powerful and how to use them to update images. The instructors explained how efficient computers are at handling repetitive menial tasks. The first few assignments consisted of declaring variables in JavaScript and adding them together. We then worked through how to multiply and divide variables, as well as what order the computer solves the equations. We looked at non-algebraic variable declarations, such as “y = y + 1”.

We began to discuss for loops and else-if statements. We learned how to use a for loop to change the first third of an image red, the second third of an image green and the final third of the image to turn blue. We followed this with learning how to write stand-alone functions. An example of a function we wrote was called colorswap. What colorswap did was interchange the values associated with two of the colors. For example, if red had a value of 250 and green had a value of 100, red would now have a value of 100 while green would have a value of 250.

After giving us an introduction to functions, they tested us by giving us a challenging problem to solve. At least, it was challenging for my skill level. We were given a picture of a panda, and had…

--

--

Brendan Massey
Brendan Massey

Written by Brendan Massey

I write about programming and computer science as well as review Coursera courses I have taken related to the aforementioned topics.

No responses yet