The _______ keyword in JavaScript is used to declare variables that are block-scoped.
- var
- let
- const
- block
The correct option is "let." In JavaScript, the "let" keyword is used to declare variables that are block-scoped, meaning they are limited to the block in which they are defined. This is different from the "var" keyword, which declares variables with function scope or global scope. "const" is used to declare constants, and "block" is not a valid keyword for variable declaration in JavaScript.
Loading...
Related Quiz
- The SQL ___________ statement is used to modify data in a database.
- What is the basic function of a switch in a network?
- Which function is used to output data to the console in JavaScript?
- You're designing a system where multiple threads need to access a shared database. How would you ensure proper synchronization to prevent data corruption?
- How does the Shortest Job First (SJF) scheduling algorithm minimize average waiting time?