Recently I have a list of useful javascript methods, You will find in the list below some of the methods that I used in my work:
//Get the current language code(LCID) :
Xrm.Page.context.getUserLcid();
//Get the organization base language code (LCID)
Xrm.Page.context.getOrgLcid();
//Get the current user id (GUID)
Xrm.Page.context.getUserId();
//Get the current user name
Xrm.Page.context.getUserName();
//Get the associated roles to the current user([]GUID)
Xrm.Page.context.getUserRoles();
//Get the current language code(LCID) :
Xrm.Page.context.getUserLcid();
//Get the organization base language code (LCID)
Xrm.Page.context.getOrgLcid();
//Get the current user id (GUID)
Xrm.Page.context.getUserId();
//Get the current user name
Xrm.Page.context.getUserName();
//Get the associated roles to the current user([]GUID)
Xrm.Page.context.getUserRoles();