user701254
user701254

Reputation: 3953

boolean argument not passing correctly

I'm new to jQuery and im just trying to pass a boolean to a function.Ive tried various amendments but still not working ?

I'm expecting the alert to be fired

isTrue(true);

function isTrue(boolean isNot){
    if(isNot){
      alert('true');
    }
}

Upvotes: 23

Views: 70736

Answers (1)

Joseph
Joseph

Reputation: 119897

JavaScript (not Java) has no type indicators, just variable names. Remove boolean

function isTrue(isNot){
    if(isNot){
      alert('true');
    }
}

Upvotes: 42

Related Questions