Which of the following is the correct way to declare a variable in JavaScript?
- var x = 10;
- x := 10;
- int x = 10;
- declare x = 10;
In JavaScript, variables can be declared using the var keyword. The other options are either used in different programming languages or are not valid syntax in JavaScript.
Loading...
Related Quiz
- You are working on a large codebase with multiple developers, and you notice inconsistencies in coding styles. How can ESLint help in maintaining a consistent coding style across the project?
- Which caching strategy involves keeping the most recently used items?
- How can specific error handlers be created to respond to different error types in Express.js?
- What is the primary difference between null and undefined in JavaScript?
- In Express.js, how can you handle errors occurring in asynchronous code within a route handler?