Entries by Génesis

Time waiting to buy my tickets

Imagine you are in a queue, every time you reach the first position you can buy just one ticket. Buyers have to wait through the line again if they want to buy more tickets. You are standing in line and has a number of tickets to purchase. Given a list of buyers with the number […]

Copying objects

JavaScript is always pass by value, except when you are working with object that is pass by reference. In JS objects are not like in other languages. An object is a collection of properties, for example an array is an object too. So, how do we copy objects straightforward? There are 2 basic options depending […]

Tree view of directories

In this example I’ve defined a web project structure in a JSON to show a basic (but beauty) tree view of folders and files. Click on folders to display 🙂