In JS you don't need to do assign, you just create a note.
But you definetely need a created entity before you can attach a note to it.
Notes can be two types a note and an attachment.
Here is the example of how you can create a simple (text) note (annotation) from JS.
function _createAnnotation(entity, subject, text) {
var orgService = GetOrganizationService();
var annotation = {};
annotation.Name = "annotation";
annotation._properties = [];
annotation._propertyTypes = [];
annotation._properties['objectid'] = entity;
annotation._propertyTypes['objectid'] = 'lookup';
annotation._properties['subject'] = subject;
annotation._propertyTypes['subject'] = 'string';
annotation._properties['notetext'] = text;
annotation._propertyTypes['notetext'] = 'string';
annotation._properties['isdocument'] = 'false';
annotation._propertyTypes['isdocument'] = 'boolean';
annotation._properties['mimetype'] = 'text/html';
annotation._propertyTypes['mimetype'] = 'string';
orgService.Create(annotation);
}
Where:
entity - (EntityReference) of the entity you want to attach a note to.
subject - (String) Subject of a note.
text - (String) Body of a note.
If you want to attach an MS office document then you need to change isdocument and mimetype parameters.