javascript - how to return Json conditionally

Viewed 17

Is it possible to change from below

  if(true){
    return {
      ...baseData,
      email: profile.email,
      permissions: "admin",
    };
  }else{
    return {
      ...baseData,
      email: profile.email,
    };
  }

to something like

    return {
      ...baseData,
      email: profile.email,
      permissions: <some code>,
    };

?

0 Answers
Related