Explaining few strange behavior of setTimeout() with code snippet

Previously also we showed you few tricky behavior of JavaScript codes. Today also few more strange things you are going to observe. The following code snippets which describes JavaScript event loop will not only help you to improve your JS knowledge, but also can be useful for you to write logic. Snippet 1: Guess the

Read More…

Polymer tutorial: Scafolding and making the first app with polymer js

In part 0 of Polymer tutorial, we’ve discussed what Polymer and web components are and why do we need polyfills. In this article we will see how to make the boilerplate for a polymer app. And how we can develop a basic app using Polymer. Setting up Polymer Polymer has few dipendencies (as web components

Read More…

Describing Polymer Js in brief with web components and polyfills

Polymer, polyfills, web components, you may have already come across these terms as you’ve started digging about Polymer Js. In this article I will try to cover what polymer exactly is, what is the team Polymer’s agenda, what are web components and why we need polyfills. People say Polymer is a JavaScript library; but in

Read More…

Smartjax.js: a jQuery plugin to make your ajax calls smarter

Smartjax stores your api responses and do not ping the server in the same ajax call for the second time. Eg: you display your logged in user’s summery in the right top cornor of your site. But to display that in every page you either need to make an ajax call, or have to make

Read More…

Setup a Node server using express to host your files – Best practice

Node provides very low level api; thus it is very difficult to host your static files using only node. There are several Node modules which do this work, like node-static, paperboy and http-server. Today we are gonna show you how to to setup a complete Node server using the most popular module of Node, that

Read More…

Get working directory name and file name in Node

__dirname : full directory path __filename: exact file location Node provides two variables named “__dirname” and “__filename” who returns the directory path of the currently executing file and the exact location of the file respectively. Both of them return string. To know in depth go through the following. Get working directory path We can get

Read More…

How to debug Node.js application with Node’s built-in debugger client

Debugging is as important as development. If you can’t debug, you wont be able to develop big applications. Node uses V8 Runtime JavaScript engine, which comes with an extensive debugger. This debugger is accessible out of process via a TCP-Protocol. Node has a built-in client which uses this debugger. Today we are going to see

Read More…

Node environment vs Browser environment

Node and web browsers, both executes JavaScript, but Node does that in server side and browsers in client side. Node uses the same JavaScript engine which is the backbone of Chrome, but still we can find few differences between Node and Browser. Node Browser  Node doesn’t have a predefined “window” object cause it doesn’t have

Read More…