Only you need to write below code in your javascript function to get current user Id:
var currentUserId = Xrm.Page.context.getUserId();
Only you need to write below code in your javascript function to get current user Id:
var currentUserId = Xrm.Page.context.getUserId();