Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
jaxim
Level 7

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
Roku Employee
Roku Employee

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