Last post Feb 23, 2017 01:41 PM by bobh0526
Member
139 Points
446 Posts
Feb 23, 2017 01:39 PM|bobh0526|LINK
I can't believe I cannot get this to work. I am trying to code a simple If, Else with a boolean value. Here is my code:
var myBoolean = true;
var myString;
If (myBoolean) {
alert('True');
}
else {
alert('False');
But I have syntax errors on the first { , the else, and the last }. What am I doing wrong?
Feb 23, 2017 01:41 PM|bobh0526|LINK
I figured it out. I used If instead of if (lowercase). It works now.
Member
139 Points
446 Posts
New to JavaScript. Need help with If, Else with boolean value
Feb 23, 2017 01:39 PM|bobh0526|LINK
I can't believe I cannot get this to work. I am trying to code a simple If, Else with a boolean value. Here is my code:
var myBoolean = true;
var myString;
If (myBoolean) {
alert('True');
}
else {
alert('False');
}
But I have syntax errors on the first { , the else, and the last }. What am I doing wrong?
Member
139 Points
446 Posts
Re: New to JavaScript. Need help with If, Else with boolean value
Feb 23, 2017 01:41 PM|bobh0526|LINK
I figured it out. I used If instead of if (lowercase). It works now.