JSOM Get current user detail

Current user detail can be retrieved with the following javascript code;

CODE