Example:
Example:
try { // Code that may throw an error } catch (error) { console.error('Error:', error.message); } finally { console.log('This code always runs'); } Answer: Functions in JavaScript are blocks of code designed to perform a specific task. A JavaScript function is executed when it is invoked (called). cisco javascript essentials 2 answers
Example: