In this article you will get to know about the Global Object in Node.js These Global Objects can be seen in modules that are their in Node.js. The Global object in Node can be considered as an object called Global.If youa are familiar with my previous articles on introduction, you may have already created our first command using Node (Click here to get the article). Move on to the same file and open your command line. Before starting move on to the Node.js Documentation to get familiar with Global objects. Here you can see the documentation has given set of Global objects,Among them setInterval,setTimeout can be considered as window objects as well . lets try an example.Here I will write an function to setTimeout function setTimeout(function(){ console.log('You are after 5 seconds'); },5000); In this function you will get an timeout of 5 seconds which will be shown in the time out of 5000 milliseconds. When you run this in the term...
Comments
Post a Comment