View Single Post
Old 08-04-2012, 06:39 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,103
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
The expression you want to evaluate must be contained in brackets.

Code:
var str = "I'm coding like a champ!"
if (str.length >10) {  // returns true or false
alert ("The length is over 10");
}
or

Code:
if ("I'm coding like a champ!".length >10) {
alert ("The length is over 10");
}

Quizmaster: What three-letter word means "at this moment"?
Contestant: Then.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Users who have thanked Philip M for this post:
Doubleflame (08-05-2012)