this binding:// Arrow function with default parameter:
const formatUrl = (path, host = "https://targetqa.com") => ${host}${path};// Callback function pattern:
function executeWithRetry(action, retries = 3) {
for (let i = 0; i < retries; i++) {
try {
return action();
} catch (e) {
if (i === retries - 1) throw e;
}
}
}
// Object destructuring:
const testConfig = { browser: "chromium", timeout: 30000, headless: true };
const { browser, timeout } = testConfig;// Spread operator to clone and override options:
const mobileConfig = { ...testConfig, viewport: { width: 375, height: 667 } };