title: deserialize JSON to JAVASCRIPT object
body: <p>i have a question to deserialize JSON text to an javascript object, i test jquery and yui library, i have this class:</p>
  
  <pre><code>function Identifier(name, contextId) {
      this.name = name;
      this.contextId = contextId;
  }
  
  Identifier.prototype.setName = function(name) {
      this.name = name;
  }
  
  Identifier.prototype.getName = function() {
      return this.name;
  }
  
  Identifier.prototype.setContextId = function(contexId) {
      this.contextId= contexId;
  }
  
  Identifier.prototype.getContextId = function() {
      return this.contextId;
  }
  </code></pre>
  
  <p>and i have this JSON:</p>
  
  <pre><code>{
  "Identifier": { 
     "name":"uno",
     "contextId":"dos"}
  }
  </code></pre>
  
  <p>I want to the parse create an Identifier object, my problem is that this sentences:</p>
  
  <pre><code>var obj = jQuery.parseJSON('{"Identifier": { "name":"uno","contextId":"dos"}}');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>var obj2 = JSON.parse('{"Identifier": { "name":"uno","contextId":"dos"}}');
  </code></pre>
  
  <p>Dont work, the var obj and obj2 aren't an Identifier object, how can i parse this?
  Thanks</p>
  
  <p>This question is not the duplicate, because it was made 5 years before than the question that Michael marks as duplicated</p>