我知道这是一个简单的术语,但我无法通过谷歌搜索得到它......当分配的变量的值通过时它叫什么?
php中的一个例子:
<?php
if($bob = 5){ echo 'The assignment came through as a truthy value!, bob now equals '.$bob.'!'; }
if($bob = false){ echo 'The assignment occurred again, but the value of the assignment is the value "false", so this if block will not be executed!. Bob now equals '.$bob.'!'; }
echo ' Finally, bob is a: '.(string) $bob;
?>
javascript中的一个例子:
bob = bob || {};