title: Set "Assigned To" on SharePoint task using Javascript object model
body: <p>I want to create a sharepoint task and assign it to myself (current user) wtihin the javascript object model. I have the code below, but I think instead of setting a particular user i need to set a spusercollection object. However, I can't seem to find any examples anywhere of how to do this. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  var clientContext = new SP.ClientContext(siteUrl);
    var web = clientContext.get_web();
     var oList = web.get_lists().getByTitle('Tasks');
      
     var itemCreateInfo = new SP.ListItemCreationInformation();
      oListItem = oList.addItem(itemCreateInfo);
      oListItem.set_item("Title","My New Item!"); 
      oListItem.set_item("Assigned To", _spPageContextInfo.userLoginName);
   oListItem.update();
  
      clientContext.load(oListItem);
      clientContext.executeQueryAsync(
          Function.createDelegate(this, this.onQuerySucceeded), 
          Function.createDelegate(this, this.onQueryFailed)
      );</code></pre>
  </div>
  </div>
  </p>