Javascript – Testing

Testing There is certainly no shortage of tools to choose from when testing your JavaScript, and the list seems to grow longer each day. One of the more popular behavior-driven tools is Jasmine. In Jasmine you use a describe function to create a test suite, but you’re really just creating a JavaScript function. Inside of that function, use the it function to specify one […]

Javascript – Server Side JS

Implementation As Wikipedia states: “Node.js is a packaged compilation of Google’s V8 JavaScript engine, the libuv platform abstraction layer, and a core library, which is itself primarily written in JavaScript.” Beyond that, it’s worth noting that Ryan Dahl, the creator of Node.js, was aiming to create real-time websites with push capability, “inspired by applications like Gmail”. In Node.js, he gave developers […]

Javascript – Asynchronous Programming

Apart from a few legacy bits that linger like the alert() function above, JavaScript is an asynchronous language.  When an event fires, all that happens is a new message is added to the queue. No event has the ability to take over the thread. Each event fired must get in the queue and wait its turn to run.  One way to illustrate […]

Javascript – Debugging and Error Handling

Before going into examples, let’s make sure that we know some basics. I highlighted four types of errors in JavaScript: Syntax errors occur at the interpretation time, they are considered as bugs and can never be handled properly because the code is just wrong by definition: 2. Program error, which is also a bug. For example, trying to read a property of undefined — […]

Javascript – Browser and Events

Events, event handlers and propagation Events are actions or occurrences that happen in the system you are programming — the system produces (or “fires”) a signal of some kind when an event occurs, and also provides a mechanism by which some kind of action can be automatically taken (that is, some code running) when the event occurs. Some examples: The […]

Javascript – Objects, Functions, and Classes

Objects Syntactically speaking, there are several ways to create an object in JavaScript. But no matter how you create an object, it’s actually abstracting an underlying API called Object.create().   Object Literal Notation Literal objects are great for one-off objects. But if you want to create two or more objects of the same type, they are not practical Constructors Another way […]

Javascript – Variables, Types, Collections

Variables, Types, and Collections Variables Keyword Scope Mutable Assignment var function yes let block yes const block no New variables in JavaScript are declared using one of three keywords: let, const, or var. JavaScript is case sensitive var is the most common declarative keyword. It does not have the restrictions that the other two keywords have. This is because it […]

AWS Cloud Practicioner Resources

Let’s explore other worlds