Tuesday, July 24, 2012

comparison – What's the equivalent way of writing inline assignment and checking PHP 'logic' but in JavaScript



In PHP you could write this:



if(false !== ($value = someFunctionCall())) {
// use $value
}


How would you write an equivalent of this in JavaScript without defining



var value;


before this comparison?






Rating: 5 out of 5 based on 3 ratings



The post comparison – What's the equivalent way of writing inline assignment and checking PHP 'logic' but in JavaScript appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/comparison-whats-the-equivalent-way-of-writing-inline-assignment-and-checking-php-logic-but-in-javascript.html

No comments:

Post a Comment