Skip to main content

Posts

Showing posts from April, 2015

$interval vs. $timeout angularjs

What is $timeout ?  The $timeout is used to call another controller function in a given time frame that means scheduling a function calls. $timeout service should be injected into a controller. $timeout used for single call to the function but $interval used for schedules for multiple repeated call in a time interval. The demo example code for $timeout as given below . var app = angular.module( "IntervalApp" , []); // $timeout service should be injected into a controller function. app.controller( "IntervalCtrl" , function ($scope, $timeout) {     $scope.count = 0;     $scope.schedulingForTimeout = function () {         $scope.count += 1;         // Call the $timeout function call after 5 seconds. Its single call after 5 second.         $timeout( function () {             $scope.schedulingForTimeout();         }, 1000);     }     $timeout( function () {         $scope.schedulingForTimeout();     }, 1000

What is Node.js? Why we use it?

What is Node.js? Node.js   is an open source and it does provide the run-time environment for creating the server side applications and i t's used to develop the real time server and networking applications. Node.js   written in JavaScript and the JavaScript code compile by V8 Google and then convert JavaScript code to machine code (native code) and i t’s run on the Window, Linux and IBM etc. Its support to the event driven architecture pattern and it handles I/O. Node.js was originally written in 2009 by Ryan Dahl . Features of Node.js ·         It is an asynchronous and event-driven system. ·         Single-threaded event-driven system ·         It is very lightweight and fast. ·         Tolling ·         Easy to configure ·         Node never buffering ·         It is highly scalable but single threaded. ·         Safe and secure. Where to use Node.js? The ability to handle the thousands of concurrent connections with single pro

39 Best Object Oriented JavaScript Interview Questions and Answers

Most Popular 37 Key Questions for JavaScript Interviews. What is Object in JavaScript? What is the Prototype object in JavaScript and how it is used? What is "this"? What is its value? Explain why "self" is needed instead of "this". What is a Closure and why are they so useful to us? Explain how to write class methods vs. instance methods. Can you explain the difference between == and ===? Can you explain the difference between call and apply? Explain why Asynchronous code is important in JavaScript? Can you please tell me a story about JavaScript performance problems? Tell me your JavaScript Naming Convention? How do you define a class and its constructor? What is Hoisted in JavaScript? What is function overloadin