[JS] Closures

Closures is a function inside a function that relies on variables in the outside function to work. Or more elaborated: A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function’s scope from an inner function. In […]

[JS] How to make an object in JS

Here is one possible way of creating an object: We could also use this alternative syntax and accomplish the same result: Additionally we can add methods to this object: Now, since all the variables are hardcoded inside the object let’s see how we can turn this a bit more abstract: Reference:JavaScript Essential Training https://www.linkedin.com/learning/javascript-essential-training-3

[wordpress] Template Hierarchy

Let’s start by an example: If your blog is at http://example.com/blog/ and a visitor clicks on a link to a category page such as http://example.com/blog/category/your-cat/, WordPress looks for a template file in the current theme’s directory that matches the category’s ID to generate the correct page. More specifically, WordPress follows this procedure: Looks for a template file in […]