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:
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