mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-08 07:46:46 +02:00
Adjusting truthy falsy section
This commit is contained in:
@@ -163,26 +163,10 @@ function test ($value) {
|
|||||||
test ($null) # => False
|
test ($null) # => False
|
||||||
test (0) # => False
|
test (0) # => False
|
||||||
test ("") # => False
|
test ("") # => False
|
||||||
test [] # => True *[] Not valid in Powershell, creates null-valued expression
|
test [] # => True *[] calls .NET classes; creates '[]' string when passed to func
|
||||||
test ({}) # => True
|
test ({}) # => True
|
||||||
test @() # => False
|
test @() # => False
|
||||||
|
|
||||||
<#
|
|
||||||
IsPublic IsSerial Name BaseType
|
|
||||||
-------- -------- ---- --------
|
|
||||||
True True Int32 System.ValueType
|
|
||||||
True True Int32 System.ValueType
|
|
||||||
True True String System.Object
|
|
||||||
You cannot call a method on a null-valued expression.
|
|
||||||
At line:4 char:1
|
|
||||||
+ $test3.getType()
|
|
||||||
+ ~~~~~~~~~~~~~~~~
|
|
||||||
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
|
|
||||||
+ FullyQualifiedErrorId : InvokeMethodOnNull
|
|
||||||
|
|
||||||
True True ScriptBlock System.Object
|
|
||||||
True True Object[] System.Array
|
|
||||||
#>
|
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
## 2. Variables and Collections
|
## 2. Variables and Collections
|
||||||
|
Reference in New Issue
Block a user