You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there are three functions put, get, and keys in the script.
Each of them ends up mutating global state, which probably isn't a good idea in the long term. You can make your functions more "pure" by using command substitution:
functionmyfunc()
{
local myresult='some value'echo"$myresult"
}
result=$(myfunc)# or result=`myfunc`echo$result
The function keys is probably the most problematic as you're creating a function and a global variable with the same name.
The text was updated successfully, but these errors were encountered:
Currently, there are three functions
put
,get
, andkeys
in the script.Each of them ends up mutating global state, which probably isn't a good idea in the long term. You can make your functions more "pure" by using command substitution:
The function
keys
is probably the most problematic as you're creating a function and a global variable with the same name.The text was updated successfully, but these errors were encountered: