Strict, Arrays, and strings oh my

Dwaylan Applewhite
2 min readSep 8, 2020

Something i’ve noticed is the notation of ‘use strict’ before we begin to write our code. Now what exactly is “use strict” and how do we use it?

Simply put, use strict means that the code MUST be used and executed in a strict mode…. Okay… that is about as clear as mud so let me try again. *Ahem* Lets say you have variables in a function that are idle or undeclared. Well, in strict mode those variables will cause an error when the code is ran, because all variables in strict mode must be declared. All variables must be connected to the function, and that is the strict rule.

Example

‘use strict’

const myRelatives = [‘Mom’, ‘Dad’, ‘Grandma’, ‘Grandpa’]

Above we have a variable that is an array of strings holding my relatives. An array of strings holding relatives? That’s right, we can now have a variables that hold multiple elements, and the names variable is an array which is notated by the scquare brackets. Inside of those brackets, 4string elements are being held, and strings are just elements inside of either quotatons or apostrophies that can be mutated.

In use strict mode the names variable is undeclared because it’s not attached to an actual funtion. So lets give our variable a purpose.

myRelatives.forEach(function(myRelatives){ console.log(‘I really miss seeing ‘ + myRelatives)})

BEHOLD! We have now given the myRelatives variable a small but meaningful purpose. We have coded to tell our program to log an I miss you statement for each of my relatives.

Hoisting… what the hell is it?

Hoisting in the physical world and hoisting in the coding world are actually very similar. I tend to think that words take on new meanings in code, because honestly so many have, but that’s not always the case.

hoist (noun) the act of raising or lifting something

So how does that apply to code?

Well, when we hoist our code we are simply saying that declared variables will always be read from the top.

How a code reads or how it is readable is essential to the success of the program. As mentioned in the last post I try to keep clean cascading lines and, as I mentioned before, lots of pseudo-code to make sure the code is completing its intended purpose.

It’s fun to stay at the EMCA

The EMCA…. what is it?

The EMCA, or European Manufacturers Communication Association, is an organization that provides guidelines and provisions for global communication standards. The EMCA provides global unification in tech which is critical because we live in a world where we utilize a global network known as the world wide web. Now imagine if every developer in every nation, country, state, and city used a different standard. Chaos. The EMCA provides a way to unify technology globally.

--

--

Dwaylan Applewhite

Millennial performing artist and aspiring tech guru.