-
-
Save bielawb/96e5da692694646187ae99d6535812a3 to your computer and use it in GitHub Desktop.
Switch - operujemy na kolekcji
This file contains 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
$użycieCpu = 50, 80, 90 | |
switch ($użycieCpu) { | |
50 { | |
"Połówka" | |
} | |
{ $_ -gt 30 } { | |
"Ciepło... ($_)" | |
} | |
{ $_ -gt 70 } { | |
"Gorąco! ($_)" | |
} | |
} | |
<# | |
Na wyjściu: | |
Połówka | |
Ciepło... (50) | |
Ciepło... (80) | |
Gorąco! (80) | |
Ciepło... (90) | |
Gorąco! (90) | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment