I tried playing with it in API Sandbox to make it function properly, but honestly I can't get that one to work.
It's the last one on the page. I fixed the easy mistake (var range =) instead of (range = ), but the rest of it I have no idea on right now.
Added a comment to that effect, but that example is beyond broken.