../blog/javascript-basics
Javascript Basics
-
How does JavaScript compare to HTML and CSS?
All I can say right now is that it was a struggle to get this into the blog template.
Jumping from HTML to CSS to Javascript like this is a different kind of challenge. It's so next level.
JavaScript is cool and fun, sometimes, but I don't think that I have a brain wired for mathematics. I love HTML and CSS, and I thought
that CSS was hard. I was thinking "boy, how much harder can JS be if CSS is so hard?".
How. Wrong. I. Was. Imagine the clapping emoji in between those words.
-
Explain control flow and loops using an example process from everyday life.
Control flow and loops are pretty hard to explain in a non JS-related sense. I guess one thing I could relate it to would be like
wiring and turning on a lamp that you've re-wired. To turn on the lamp, you need to make sure that the electricity runs through the
closed loop, or else the lamp won't turn on. The electricity needs to be controlled at a certain wattage to give the lamp a certain
glow, depending on the lightbulb you have in the lamp, and to do that you need to control the wattage and make sure the wiring
is secure.
-
Explain the difference between accessing data from arrays and objects.
Arrays are variables which can hold more than one value at a time. An object can be anything from a number to a string to
an expression. An array is an object. Accessing data from an object is basic, but accessing data
from an array will always be confined to the array but can contain a bunch of different objects.
-
Explain what functions are and why they are useful.
Functions are the blocks of code which are designed to perform a specific task. A function is called, usually at the beginning of the
code, to specify what the code is meant to do from there. They are useful because they are commands. You can define exactly what
a function will do with different variables and parameters.