user17316007
user17316007

Reputation:

I'm getting a "ReferenceError: invalid assignment left-hand side" error for this code. I can't see whats wrong

Broken Code

const calcTip = function (bill) {
    if (bill >= 50 && bill =< 300) {
        return 0.15 * bill;
    } else {
        return 0.2 * bill;
    }
}

New to this, still early learning phase.

Just cannot see what is causing the error in the second line?

Any help would be much appreciated.

Upvotes: 0

Views: 59

Answers (1)

Martin Bekkos
Martin Bekkos

Reputation: 56

replace

"=<" with "<=" 

:)

Upvotes: 1

Related Questions