There is active directory group added to SharePoint group. How would we can check that the logged in user is member of that active directory group using ECMA script?
You can't out of the box.
If you still need to do this, then look into expanding the rest api, to allow this. But a caveat on this, is this will only be possible on premises.