Myths of the Near Future

by Yanis T

Ruby and JavaScript enthusiast.

Page 2

JavaScript hacks explained

There are several JavaScript tricks that are used widely by experienced programmers. Many of them may not be instantly obvious, especially for beginners. These tricks use language features not by their direct purpose, but rather by their side-effect to achieve goals, that can’t be achieved by default language means. Here I made a little compilation of such tricks with explanation.

You should understand that most of these tricks are rather hacks and not something you should use in your daily development. The purpose of that article is to explain how they work, not to push to use them.

 Using !! to convert value into a boolean

Everything in JavaScript can be interpreted either as [truthy or falsy](‘’). This means that when you put object into an if expression, it will either let you go by true-branch (i.e. it’s ‘truthy’) of by false

Continue reading →

JavaScript for Java developers

Even if you don’t have to directly work with JavaScript I think it’s worth investing your time in learning JavaScript and I want to encourage you to do that with that little overview article. So if you are a java-developer and you want to catch a bit with JavaScript this is a good place to start.

I also must warn you that I’m not aiming to cover every aspect of JavaScript in this article. Instead I just want to focus on most confusing concepts for Java developers, because well… yeah… JavaScript can be confusing. Especially when it tries to pretend something which it isn’t.

 Object-oriented, but no classes

Alright, here is the thing to start with. There are no classes in JavaScript. Almost everything is an object. Even arrays, even function, but there are no classes as cornerstone language construct. While Java forces you to describe behaviour of your objects before you can initiate

Continue reading →