Blog Post_202

James Messina
2 min readFeb 3, 2021

Austin Coding Academy

  1. In my last assignment I learned how to make additional unit tests. It was a little different in my pre-course work that I took last year but not by too much. I learned how to make an ‘actual’ variable and assign it to a call to the RPS function using inputs of choice. This will return whatever actual output from the function. Next, I made ‘expected’ variable and assigned it to what I expect the output to be based on the actual inputs I used. Lastly I learned how to use the assert. Equal function/method and used the actual and expected variables as the arguments for my input parameters.
  2. “use strict”; states that the Javascript code should be executed in strict mode. It is a literal expression and in this mode you can’t do certain things such as using undeclared variables. Furthermore, it is added to the beginning of a script or function. Advantages are that it makes it easier to write ‘secure’ JavaScript and changes previously accepted ‘bad syntax’ into real errors. You can’t accidently create global variables with “use strict.” Some disadvantages are that you have to declare all variables and also they cant be deleted.
  3. Function hoisting is JavaScript’s default behavior of moving declarations to the top of the current scope. In JS, a variable can be declared after it has been used.
  4. ECMA is important because it sets the international standards for JavaScript so that companies can use the open standard language to develop their implementation of JS.
  5. To increase the maintainability of my code I have been using comments (//), git status — git add- git commit- and git push, checking for errors, debugging, writing all sorts of conceivable unit tests, condensing code for fast processing time, and fixing the core problem not the symptoms.
  6. The global space of a website should be left alone because it’s more difficult to read code when the variables are not declared right in the function (and for instance in the global space). anyone can update a global variable at any point in the program at any time. Also its easy to encounter global variable name clashes since there's only one namespace.

--

--