Created
January 26, 2021 15:55
-
-
Save PrateekKumarSingh/ff0e693f3c459a6829e840f5d99f300a 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
# value type variable | |
$valueVar = 0 | |
# reference type variable | |
$referenceVar = [ref]0 | |
function increment { | |
$valueVar++ # increment value type variable | |
$referenceVar.Value++ # increment reference type variable | |
} | |
increment # function call | |
# output | |
$valueVar # result: 0 | |
$referenceVar # result: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment