title: How can I serialize a function in JavaScript?
body: <p>For example, say I have a function defined as follows:</p>
  
  <pre><code>function foo() {
    return "Hello, serialized world!";
  }
  </code></pre>
  
  <p>I want to be able to serialize that function and store it using <code>localStorage</code>. How can I go about doing that?</p>