Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jaxim
Visitor

Delete a variable?

How do I delete a variable after I am done using it?
I've created a variable in one function:
m.foo = "bar"

Then in a different function, I'd like to delete it since I no longer need it and wish for the variable to no longer take up any more memory space. How can I do this?
0 Kudos
1 REPLY 1
NB_
Roku Guru

Re: Delete a variable?

assigning `invalid` to it will do (think NULL, nil, None)
m.foo = invalid

and so will explicitly removing it from the dictionary
m.foo.delete("foo")
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.