How to create a winRT javascript helper function