Explain the concept of CORS (Cross-Origin Resource Sharing).
CORS is a security feature implemented by web browsers to restrict web pages from making requests to a different domain than the one that served the web page.
What is the purpose of the 'async' and 'await' keywords in JavaScript?
The 'async' keyword is used to declare an asynchronous function, and 'await' is used to pause the execution of the function until the Promise is settled.
Example:
async function fetchData() { let response = await fetch('https://api.example.com/data'); let data = await response.json(); console.log(data); }
How does the 'localStorage' differ from 'sessionStorage' in HTML5?
'localStorage' persists even when the browser is closed and reopened, while 'sessionStorage' data is only available for the duration of the page session.
Hoisting is a JavaScript behavior where variable and function declarations are moved to the top of their containing scope during the compilation phase.
Explain the 'same-origin policy' in the context of web security.
The 'same-origin policy' is a security measure that restricts web pages from making requests to a different domain than the one that served the web page.
Explain the concept of 'Progressive Enhancement' in web development.
Progressive Enhancement is a strategy where the core functionality and content are delivered to all users, with enhanced features provided to those with modern browsers or devices.
What is the purpose of the 'V8' engine in the context of JavaScript?
The 'V8' engine is an open-source JavaScript engine developed by Google, used in Chrome and Node.js, responsible for executing JavaScript code in the browser or server environment.
Explain the purpose of the 'SQL JOIN' operation in database queries.
The 'SQL JOIN' operation combines rows from two or more tables based on a related column, allowing the retrieval of data from multiple tables in a single query.
Example:
SELECT users.username, orders.order_id FROM users JOIN orders ON users.user_id = orders.user_id;