For this Question: You need to complete the function <code>findTax()</code> that takes a number type variable as an argument which is the salary of a person.
You need to calculate the tax amount on his salary by using Js switch control flow.
The tax rates are given below.<ol>
<li>if   500000<= salary >0 then 0% tax on the entire salary
<li>If   1000000 >= salary > 500000 then 10% tax on the entire salary
<li>If   1500000 >= salary > 1000000 then 20% tax on the entire salary
<li>If   salary >1500000 then 30% tax on the entire salary
</ol>
If someone by mistake enters a salary that is less than 0 then you need to throw the <code>ValidationError()</code> error whose argument will be <code>"Salary not valid"</code>. Put this code inside a <code>try-and-catch</code> block, so that the error is caught in the catch block, and then <code>"Salary not valid"</code> should be returned.The <code>findTax</code> function would take salary as the only argument whose data type will be numberThe <code>findTax</code> function should return the tax amount calculated, provided the <code>salary</code> is above 0. If the salary is below zero, then <code>"Salary not Valid"</code> must be returned from the catch block which would catch the error.const answer =findSalary(1600000)
console.log(answer) //prints 480000

const answer =findSalary(-3435)
console.log(answer) //prints "Salary not valid", I have written this Solution Code: function findTax(salary) {
    let tax = 0;
    try {
        if (salary <= 0) {
            throw new ValidationError("Salary not valid");


        }
    } catch (err) {
        return err.message;
    }
    switch (true) {
        case salary > 0 && salary <= 500000:
            tax = 0;
            break;
        case 1000000 >= salary && salary > 500000:
            tax = salary * 0.1;
            break;
        case 1500000 >= salary && salary > 1000000:
            tax = salary * 0.2;
            break;
        case salary > 1500000:
            tax = salary * 0.3;
            break;
        default:
    }
    return tax;
}
, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?