Using functions in installed sheet scope

How do I use the RIGHT() function on the code sheet? Does it need to be preceded by some object? Can I write this: var lastLetter= right(MyWord,1)
It’s not working.