In JavaScript timing events come in two flavors: setTimeout(function, milliseconds) Executes a function, after waiting a specified number of milliseconds. setInterval(function, milliseconds) Same as setTimeout(), but repeats the execution of the function continuously. Here is a code to implement setInterval code using setTimeout, also we have a method to clear the interval. 1 2 3 […]

Read More →

How many ways can we save some data on the browser(client) end and retrieve it back even after a refresh: We can use localstorage or sessionstorage Use cookies Rewrite URL(although not elegant, but still can get the job done) Appending/Prepending to the name attribute on the window object You can try opening up any webpage […]

Read More →

My BlogPost when VS Code was first announced earlier this year VS Code is a new type of tool that combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. Code provides comprehensive editing and debugging support, an extensibility model, and lightweight integration with existing tools. VS Code helps […]

Read More →

Let’s take the following example: 1 2 3 4 5 6 7 var arr = [1,2,3,4]; arr.forEach(function(val){ if(val===2){ return false; } console.log(val); });var arr = [1,2,3,4]; arr.forEach(function(val){ if(val===2){ return false; } console.log(val); }); You would expect it to just print 1, instead it prints 1,3,4. You might yell WTH, but thats how the forEach method […]

Read More →

In an angularjs application if you have encountered [$compile:multidir] error then you must be having multiple directives applied to the same DOM element, and processing them would result in a collision or an unsupported configuration. To resolve this issue remove one of the directives which is causing the collision. Example scenarios of multiple incompatible directives […]

Read More →