SP.Utilities.PrincipalInfo.principalId property (sp.js)

Gets a value that specifies an identifier for the principal.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var value =SP.Utilities.PrincipalInfo.get_principalId()
          

Return value

Type: Number

Remarks

It must be -1 if the principal does not belong to the current site.