For this Question: Complete the function <strong>handleCallback</strong> which has a single argument <code>callback</code>, which may or may not be a function.

Create a <strong>try</strong>, and <strong>catch</strong>  block. Call the <code>callback</code> function inside the <strong>try</strong> block. In case <code>callback</code> is not a function, an error will be thrown which should be caught in the <strong>catch</strong>  block. The <code>catch</code> block should print <code>"error thrown"</code> to the console.


<strong>Note:</strong> To check the expected output, we have already created a <code>anyCallback</code> function which prints <code>"No error thrown"</code> to the console. Just add <code>anyCallback</code> function without the parenthesis, to the input field to check the result.The <strong>handleCallback</strong> function takes in one argument, which may or may not be a function.The <strong>handleCallback</strong> function prints a string <code>"error thrown"</code> in the console, if the argument is not a function, otherwise nothing should be returned or printed.<strong>Example 1:</strong> Giving no function as an argument to the function
handleCallback() // prints "error thrown"

<strong>Example 2:</strong> Giving <code>anyCallback</code> function as an argument to the function
handleCallback(anyCallback) // prints "No error thrown", I have written this Solution Code: function handleCallback(callback) {
  try {
    callback();
  } catch (error) {
    console.log("error thrown");
  }
}, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?