What is the difference of using var and not using var in repl while dealing with variables?



What is the difference of using var and not using var in repl while dealing with variables?..

Answer / Mohammad Naseem

In Node.js REPL, using 'var' declares a variable globally if it's outside a function or locally within the function. If you don't use 'var', then the variable is treated as a global one.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Node.js Interview Questions

What is the purpose of node.js module.exports and how do you use it?

1 Answers  


What are the benefits of using node.js?

1 Answers  


What do you mean by event emmitter?

1 Answers  


Explain the concept of middleware in node.js?

1 Answers  


What do you mean by “streams”?

1 Answers  


What are Node.js Http module limitations?

1 Answers  


Why Node.js application is scalable?

1 Answers  


What do you understand by the term i/o?

1 Answers  


Explain node.js architecture?

1 Answers  


What are various node.js REST API frameworks?

1 Answers  


Explain ecmascript?

1 Answers  


What is npm for?

1 Answers  


Categories