Advantcomp Consulting Blog

  • Understanding Scope and Closure in JavaScript, A Design Pattern for Data Encapsulation

    Posted in Tutorials on Nov 19, 2016

    In this post I will explain what scope is and how it works in JavaScript. Then I will go on to show a design pattern that allows one to use scope in order to encapsulate data in an object making it only visible inside that object, as well as through getter and setter methods. If you feel like you have a firm grasp of scope, skip to the bottom section. Programming languages have something called a namespace. The namespace is the set names currently used to identify a value or address in a language, i.e. the variables and the reserved words from the language. As the size of a program grows so does the need to manage the namespace. Read More

  • A friendly introduction to making your own animations on the web using JavaScript

    Posted in Tutorials on Mar 09, 2016

    Back in the days of yore, if you wanted to animate something on the web you’d use Flash. Flash has largely died out because it was a big black box in the middle of a field of open technologies. Today, there are many different ways to try and animate behaviour on the web. Generally speaking, there are three “native” ways that don’t involve plugins like flash: CSS animations JavaScript animations  animations (a special kind of JavaScript animations). Read More