You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function calcTax(state: string, income: number, dependents: number) : number { 1
if (state === 'NY'){
return income * 0.06 - dependents * 500;
} else if (state ==='NJ'){
return income * 0.05 - dependents * 300;
}
}
1 The function arguments and its **return value** have type annotations.
The correct way is...
function calcTax(state: string, income: number, dependents: number) : number {
if (state === 'NY'){
return income * 0.06 - dependents * 500;
} else if (state ==='NJ'){
return income * 0.05 - dependents * 300;
}
return 0; // !!!!
}
The text was updated successfully, but these errors were encountered:
Error Source:
The correct way is...
The text was updated successfully, but these errors were encountered: