type Context={ appId?: string userId?:string } function log(msg:string, context:Context){ let time=new Date().toISOString(); console.log(time,msg,context.userId); } log('haha',{appId:'id',userId:'userId'})