Created
April 17, 2013 14:38
-
-
Save stej/5404822 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This works: | |
$a = '' | |
$b = @('') | |
( $a -eq $b ) -ne ( $b -eq $a ) | |
now, the ( $a -eq $b ) is true, because $b is converted to string -> all the array members are converted to string and then concatenated by $ofs -> | |
it equals ('' -eq '') which is true | |
then ( $b -eq $a ) means (@('') -eq '') - this returns all items from array (left operand) that are equal to right operand -> it's array of '' | |
now array of '' is converted to boolean value | |
@('') converted to boolean returns $false probably because there isn't any not-empty string | |
-> | |
$true -ne $false returns $true | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment