Comparison of programming languages (associative array): Difference between revisions

Content deleted Content added
Line 943:
</source>
 
Keys and values can be any [[.NET Framework|.NET]] object type, e.g.:
 
<source lang="text">
$now = [DateTime]::Now
$tomorrow = $now.AddDays(1)
$ProcessDeletionSchedule = @{
(Get-Process Notepadnotepad) = $now
(Get-Process calc) = $tomorrow
}
</source>
 
 
It is also possible to create an empty associative array and add single entries or even other associative arrays to it later on.
Line 962:
</source>
 
New entries can also be added by using the array index operator, the property operator or the <code>Add()</code> method of the underlying [[.NET Framework|.NET]] object:
 
<source lang="text">
Line 991:
</source>
 
Hash tables can be added, e.g.:
 
<source lang="text">
$hash1 = @{ a=1; b=2 }
$hash2 = @{ c=3; d=4 }
$hash3 = $hash1 + $hash2
</source>