JavaScript if far from being the best-designed language in the world. I personally often feel myself like in the mine field when coding in it. But it evolves and gets better and better. I can increasingly better express the ideas in JavaScript and I feel it becomes truly powerful and pretty pleasant language to use….Continue Reading “Using array destructuring and recursion to make your JavaScript algorithms shine”

TypeScript, although very promising language, does not solve fundamental JavaScript’s issue (feature?) with “this” property binding. TypeScript can lead to unfortunate errors since it is heavily used by people coming from C#/Java communities, who bring coding patterns with them. Let’s have a look at code example from TypeScript playground: class Greeter { greeting: string; constructor(message:…Continue Reading “TypeScript is actually JavaScript and one still has to be careful”

From time to time I do the same error when trying to export some variable from whatever kind of JavaScript module: function createStudent(aName) { var name = aName; function setName(aName) { name = aName; } function getName(aName) { return name; } return { name: name, setName: setName, getName: getName }; } var s = createStudent(“Alexander”);…Continue Reading “Exporting a variable from JavaScript module”