What is the use of Underscore variable in REPL?
Use _ to get the last result.
C:\Nodejs_WorkSpace>node > var x = 10 undefined > var y = 20 undefined > x + y 30 > var sum = _ undefined > console.log(sum) 30 undefined >View
What is the difference of using var and not using var in REPL while dealing with variables?
Use variables to store values and print later. if var keyword is not used then value is stored in the variable and printed. Wheras if var keyword is used then value is stored but not printed. You can use both variables later.View
What is REPL in context of Node?
REPL stands for Read Eval Print Loop and it represents a computer environment like a window console or unix/linux shell where a command is entered and system responds with an output. Node.js or Node comes bundled with a REPL environment. It performs the following desired tasks.
Eval - Takes and evaluates the data structure
Print - Prints the result
Loop - Loops the above command until user press ctrl-c twice.
Is Node a single threaded application?
Yes! Node uses a single threaded model with event looping.View
What is ‘Callback’ in node.js?
Callback function is used in node.js to deal with multiple requests made to the server. Like if you have a large file which is going to take a long time for a server to read and if you don’t want a server to get engage in reading that large file while dealing with other requests, call back function is used. Call back function allows the server to deal with pending request first and call a function when it is finished.View
Mention the framework most commonly used in node.js?
“Express” is the most common framework used in node.jsView
What is the command that is used in node.js to import external libraries?
Command “require” is used for importing external libraries, for example, “var http=require (“http”)”. This will load the http library and the single exported object through the http variable.View
What does it mean “non-blocking” in node.js?
What are the Challenges with Node.js ?
Emphasizing on the technical side, it’s a bit of challenge in Node.js to have one process with one thread to scale up on multi core server.View
What is the difference between Node.js vs Ajax?
How Node.js overcomes the problem of blocking of I/O operations?
Node.js solves this problem by putting the event based model at its core, using an event loop instead of threads.View
What are the pros and cons of Node.js?
b) Crawlers receive a full-rendered HTML response, which is far more SEO friendly rather than a single page application or a websockets app run on top of Node.js.
a) Any intensive CPU computation will block node.js responsiveness, so a threaded platform is a better approach.
b) Using relational database with Node.js is considered less favourable
Mention the steps by which you can async in Node.js?
By following steps you can async Node.js
a) First class functions
b) Function composition
c) Callback Counters
d) Event loopsView
What is an event loop in Node.js ?
To process and handle external events and to convert them into callback invocations an event loop is used. So, at I/O calls, node.js can switch from one request to another.View
What are the two arguments that async.queue takes?
The two arguments that async.queue takes
a) Task function
b) Concurrency valueView
Why node.js is quickly gaining attention from JAVA programmers?
Using the event loop what are the tasks that should be done asynchronously?
a) I/O operations
b) Heavy computation
c) Anything requiring blockingView
Can you access DOM in node?
No, you cannot access DOM in node.View
Does node run on windows?
Yes – it does. Download the MSI installer from http://nodejs.org/download/View
Why Node.js is single threaded?
For async processing, Node.js was created explicitly as an experiment. It is believed that more performance and scalability can be achieved by doing async processing on a single thread under typical web loads than the typical thread based implementation.View
© 2017 QuizBucket.org