Parse user data in to student and teacher details
A short review;

You can avoid process typeless and admin users by using an upfront .filter()
obj is a terrible name (it implies the parameter is just an Object instead of an Array, list would be better, something meaningful like userDetails the best
If you want to go for slightly less efficient code, you could replace the whole loop with 2 filters
Dont go for fat arrow syntax unless you are coding and inline function

I would go for something like this;
function createUsersInfo(userDetails){
  const cleanUserDetails = userDetails.filter(user =&gt; (user.type &amp;&amp; user.group != 'admin'));
  return {
    studentDetails: cleanUserDetails.filter(user =&gt; user.type === 'student'),
    teacherDetails: cleanUserDetails.filter(user =&gt; user.type === 'teacher')
  };
}