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
RokuNB
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