Javascript custom array sorting functions

One of the most useful features that many languages offer is the possibility of sorting arrays and lists of elements in the most disparate ways. Let’s create our array sorting functions.Unlike more typed languages, in the case of Javascript arrays can have profoundly different types of elements, including primitives and […]

Read More…

Angular cascading recursive selects from tree nodes

Recursive selects from tree nodes

Today we will see recursive selects from tree nodes.Nothing proves the saying “if you want something done right, do it yourself” better than recursion.Recursion is one of my favorite topics. When a function is recursive, it finds in itself the strength to solve a task. We can also see recursion […]

Read More…

Multiple nested guards on one route

angular multiple nested guards on one route

We may need multiple guards on one route in some situations. It may happen that sometimes a shared guard is needed between several components which however require further and different verifications.A possible solution in those cases may be to insert “matryoshka” Guards, making the focus of the work on one […]

Read More…

Easy way to show/hide a password field in Angular

angular show or hide a field

The most easy way to show/hide a password input field in Angular is to toggle a show/hide property. For both methods I will use the FontAwesome icon library but you are free to use the icons you prefer. You can choose between two simple recipes, one with click event and […]

Read More…

Javascript exercise of random cards

An exercise of javascript random cards

It happened to me once to complete an interesting and curious javascript exercise of random cards. The request was as follows: ” Having a deck of French cards (consisting of 52 cards), 10 cards must be drawn (using the Math.random function). Of those decide the suit and number of each […]

Read More…