How to get current user name using JavaScript in Script Editor web part?
If you are in a SharePoint Page just use:
_spPageContextInfo.userId;