Easiest way to go from Javascript Value -> Contact Property


I have a javascript function that returns a value. I want to assign this value to a property of the contact viewing a page that currently has the javascript function on it. What is the simplest way of accomplishing this? Thanks!