Category JavaScript

JavaScript elegant namespace declaration

Emulating multilevel namespaces behavior in JavaScript shouldn’t be so complicated. We all know that namespacing in JavaScript is done by nesting objects. But for each nested object we have to check if it already exist so we wont overwrite it with the new object. This can happen if you write a lot of code and […]

JavaScript function overloading

For those who are used to Java and/or C++ it is weird that some functional languages like JavaScript and Python do not support function overloading. Even though I love dynamic functional  languages, the noted two are my favorite, I really miss this functionality, cause sometimes the functions are too small to pass variables in an […]

JavaScript data type detection

Sometimes it is really useful to know the datatypes, especially when it comes to iterating arguments passed to a function or accepting one argument of variable types, as we are going to see in some practical examples to come. As we know data types in JavaScript are not strict, they are the loosest ever and […]