Why does Javascript use JSON.stringify instead of JSON.serialize?
<p>I'm just wondering about <em>"stringify"</em> vs <em>"serialize"</em>. To me they're the same thing (though I could be wrong), but in my past experience (mostly with <a href="/questions/tagged/asp.net" class="post-tag" title="show questions tagged 'asp.net'" rel="tag">asp.net</a>) I use <code>Serialize()</code> and never use <code>Stringify()</code>.</p>

<p>I know I can create a simple alias in Javascript,</p>

<pre><code>// either
JSON.serialize = function(input) {
    return JSON.stringify(input);
};

// or
JSON.serialize = JSON.stringify;
</code></pre>

<p><a href="http://jsfiddle.net/HKKUb/">http://jsfiddle.net/HKKUb/</a></p>

<p>but I'm just wondering about the difference between the two and why stringify was chosen.</p>

<hr>

<p>for comparison purpose, here's how you serialize XML to a String in C#</p>

<pre><code>public static string SerializeObject&lt;T&gt;(this T toSerialize)
{
    XmlSerializer xmlSerializer = new XmlSerializer(toSerialize.GetType());
    StringWriter textWriter = new StringWriter();

    xmlSerializer.Serialize(textWriter, toSerialize);
    return textWriter.ToString();
}
</code></pre>
