jeudi 26 novembre 2020

How to do this IF with ternary operators

how can I do this IF with ternary operators?

if (img != null) {
  return img;
} else if (!user) {
  return 'img.svg';
} else if (user) {
  if (user.img && !camera) {
    return `imgServer`;
  } else if (!user.img && !camera) {
    return 'img.svg';
  } else if (user.img && camera) {
    return camera;
  } else if (!user.img && camera) {
    return camera;
  }
} 

I already tried it in several ways, but none of them work for me.

Aucun commentaire:

Enregistrer un commentaire