Tag Archives: JavaScript

JS features you better know 1

In scope of functions arguments is local variable provides some nice features we can use in our code. First you don’t need to define any parameters for a function. You can just use arguments and will get arguments passed to the function. function sum(){ var ret = 0; for (var i = 0; i < [...]
Posted in post | Also tagged | Leave a comment

take control over class constructor

Javascript doesn’t give us simple way to control object constructing. We have new operator, but we cannot control it. Unless we do some magic. Lets assume we have an observer instance, few classes and we want every instance of this classes to be ‘observed’. var observer=[]// simplest ever function foo(){ this.foo="foo"; .... } function bar(){ [...]
Posted in post | Tagged | Leave a comment

javascript constructor with arguments

There was an interesting question on stackoverflow recently. Nobody had right answer. Now after few days i got it! It is really a peace of JS art. The question was if it is possible to call constructor like this: someClass(arg1,arg2,...,argN){ .... //implementation } having just an Array of arguments [arg1,arg2,...,argN]. First thought was just to [...]
Posted in post | Also tagged | Leave a comment

Google Web perfomance initiative.

Gogle initiates a really great project recently: Let’s make the web faster So Optimizing JavaScript code article got in scope of my interest. Conclusions: use [<string>,<string>,<string>].join(“”) for string concatenation (* this is pretty well known rule) use prototype method defining rather than defining method inside closure Creating a closure is significantly slower then creating an [...]
Posted in post | Also tagged | Leave a comment

Javascript performance. Array vs Object.

Big JavaScript application needs big storage. JS gives us 2 options Array and Object. I have tested following cases: writing data writing data randomly reading data reading data randomly I have tested this in following browsers: IE FF Chrome I want to point out that i am not comparing browsers. I am comparing two methods [...]
Posted in post | Also tagged , , | Leave a comment

Javascript performance summary

I have an idea that Javascript could allow us to improve perfomance of our web applications. Of cause JS is very slow but unlike server side code we can run it on side of our clients. Something like client side cloud-computing. It is jut an idea… for now. Thing i can do right now is [...]
Posted in post | Also tagged , , | Leave a comment

Who am i and what is this blog about

This is the only private message you will see in this blog. Since all the thoughts i have about JavaScript and Front-end development totally occupied my mind i have to make this Blog to get them in order. I am a web developer. My main area of interest for now is a JavaScript. Yes i [...]
Posted in post | Also tagged | Leave a comment