The gs.getUserID method is used to determine the sys_id of the currently logged-in user.
sys_id is the unique identifier column available in all ServiceNow tables, including any custom table created by an admin, and also the sys_user table, which stores user records.
Usage:
gs.getUserID(); //return the sys_id of the currently logged in user
Example:
gs.log( "The current logged in user ID is "+ gs.getUserID() );