JavaScript Assessment
Evaluate your development skills
Semi-Senior Level
20
Questions
🎯
Adaptive
70%
To Pass
JavaScript ES6+
Node.js
RESTful APIs
Async/Await
Promises
⚡ Test your modern JavaScript development skills

Test Semi-Senior Level
Question 1 of 3
What is the difference between var, let and const in JavaScript?
- var has block scope, while let and const have global scope.
- var allows variable redeclaration, but let and const do not.
- let and const do not allow value assignment, but var does.
- const allows changing the variable value, but let and var do not.
What is the concept of "hoisting" in JavaScript?
- It is the ability to move functions to the top of the file.
- It is the behavior by which variable and function declarations are moved to the beginning of their scope during compilation.
- It is the ability to create objects with limited scope.
- It is the ability to make code cleaner and easier to read.
What is a Promise in JavaScript?
- A function that can return multiple values simultaneously.
- An object that represents the eventual completion (or failure) of an asynchronous operation.
- A conditional structure that evaluates boolean values.
- A type of loop used to iterate over array elements.
What is the difference between == and === in JavaScript?
- == compares values, but === compares both data types and values.
- == compares both data types and values, but === only compares values.
- There is no difference; both perform the same comparison.
- == compares only numbers, while === compares strings.
What is the "event loop" in JavaScript?
- It is an execution cycle that repeats endlessly until the code finishes.
- It is a mechanism that executes asynchronous tasks in the browser's main thread.
- It is a method that stops the execution of code until the task completes.
- It is an algorithm used to sort data efficiently.
What is a "closure" in JavaScript?
- A function that accesses variables from its external environment even after the environment has finished executing.
- A function that runs immediately after being defined.
- A method for handling errors in JavaScript.
- A way to create private variables within an object.
What does the "this" keyword do in JavaScript?
- Refers to the global object, regardless of context.
- Refers to the object in which the function was called.
- Refers to the value returned by the function.
- Has no value, it is simply a placeholder.
How do you handle errors in JavaScript?
- Using catch only.
- Using try, catch, and finally.
- Using finally only.
- Using throw only.
What is the difference between pure and impure functions?
- Pure functions have no side effects, while impure functions do.
- Impure functions cannot return values.
- Pure functions are slower than impure ones.
- There is no difference between pure and impure functions.
What is the "spread operator" in JavaScript?
- A method to iterate over array elements.
- A function used to split an object into multiple objects.
- An operator that spreads an iterable into individual elements.
- An operator that allows copying elements from one object to another.
What is JSX in React?
- A JavaScript extension that allows writing HTML within JavaScript code.
- A type of database to store React components.
- An additional library to optimize React.
- A compiler that converts HTML into JavaScript.
What is the difference between a class component and a functional component in React?
- Class components have a shorter lifespan than functional ones.
- Functional components cannot handle state or lifecycle methods.
- Class components are more efficient than functional ones.
- Functional components cannot use hooks.
What is Redux in React?
- A library for managing state in React applications.
- A package for server-side rendering React components.
- A tool for creating databases in React applications.
- A set of pre-built components for use in React.
How do you handle asynchronous operations in Node.js?
- Using promises and the await keyword.
- Using setTimeout and setInterval.
- Using callbacks only.
- Using for loops to control execution.
What is middleware in Express.js?
- A mechanism that intercepts and modifies HTTP requests.
- A way to secure routes in an application.
- An external service that communicates with your Express server.
- A method for improving database performance.
What is a RESTful API?
- A set of rules for communicating between applications over HTTP using methods like GET, POST, PUT, and DELETE.
- A programming language for writing web applications.
- A database that communicates with frontend applications.
- A cloud-based data storage system.
How can you secure a RESTful API?
- By using SSL/TLS and OAuth authentication.
- Only by using public keys in requests.
- Only by validating user inputs.
- By using an encrypted database.
What is CORS (Cross-Origin Resource Sharing)?
- A security protocol for sharing resources between different origins.
- A service that allows users to share data with multiple applications.
- An error that occurs when an application connects to the wrong server.
- A method for securing data within a database.
What are NoSQL databases?
- Databases that use SQL for queries.
- Databases that do not follow a fixed schema and can be more efficient in some cases.
- Databases that only store plain text data.
- Databases that are easier to manage in large-scale systems.
What is the concept of "callback hell"?
- It is a term used when multiple callback functions are nested and hard to manage.
- It is an error that occurs when callbacks are used incorrectly.
- It is a type of error that happens when a callback returns an incorrect value.
- It is the process where callbacks execute sequentially.
TIME LEFT
5:00