can you make some example javascript code that uses that method