Do you need to declare variables in javascript?



Do you need to declare variables in javascript?..

Answer / Vikas Negi

While JavaScript does not require explicit variable declaration, it is considered best practice to use either the `var`, `let`, or `const` keyword for declaring variables to avoid creating global variables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

Explain the for-in loop?

1 Answers  


What is Associative Array? How do we use it?

1 Answers  


I am providing the Online& class room training on Worksoft Certify for SAP/HTML/JAVA using real time scenarios in a real time environment for a real time project, If any one is interested please get in touch with me on aimansaud@gmail.com

1 Answers   Intel,


You have an asp. Net web application running on a web-farm that does not use sticky sessions - so the requests for a session are not guaranteed to be served the same machine. Occasionally, the users get error message validation of view state mac failed. What could be one reason that is causing this error?

1 Answers  


How can I learn coding fast?

1 Answers  


What are javascript functions?

1 Answers  


How will you explain closures in javascript? When are they used?

1 Answers  


What is spread operator react?

1 Answers  


what is lazy fetching in hibernate

1 Answers   iGate, Infosys,


How much do javascript programmers make?

1 Answers  


How do you include a comment in javascript?

1 Answers  


How to access the value of a textbox using javascript?

1 Answers  


Categories