Ternary Operator alternatives for more than 2 values

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
7
down vote

favorite












In my react-native applications, i had written a code like this.



 return ( 
<PersonHandler
profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
firstName=item.user.firstName
lastName=item.user.lastName

buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING

submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
onButtonPress=() => this.onUnfollowPress(item)
/>
);


Now I have more than 2 statuses to handle, so the ternary operator here cannot be used. What will be the best approach to handle a situation like this?



I have 3 statuses now. 0, 1 and 2. According to the status I have to handle the following conditions.



 buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING









share|improve this question





















  • You can use if else ladder or switch case for this purpose
    – Abinash Ghosh
    3 hours ago











  • You know you can write item.status === 0 ? A : (item.status === 1 ? B : C) right?
    – Rafalon
    3 hours ago










  • Nested ternaries are great. Read this stuff from Eric Elliot - medium.com/javascript-scene/…
    – Meet Zaveri
    3 hours ago














up vote
7
down vote

favorite












In my react-native applications, i had written a code like this.



 return ( 
<PersonHandler
profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
firstName=item.user.firstName
lastName=item.user.lastName

buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING

submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
onButtonPress=() => this.onUnfollowPress(item)
/>
);


Now I have more than 2 statuses to handle, so the ternary operator here cannot be used. What will be the best approach to handle a situation like this?



I have 3 statuses now. 0, 1 and 2. According to the status I have to handle the following conditions.



 buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING









share|improve this question





















  • You can use if else ladder or switch case for this purpose
    – Abinash Ghosh
    3 hours ago











  • You know you can write item.status === 0 ? A : (item.status === 1 ? B : C) right?
    – Rafalon
    3 hours ago










  • Nested ternaries are great. Read this stuff from Eric Elliot - medium.com/javascript-scene/…
    – Meet Zaveri
    3 hours ago












up vote
7
down vote

favorite









up vote
7
down vote

favorite











In my react-native applications, i had written a code like this.



 return ( 
<PersonHandler
profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
firstName=item.user.firstName
lastName=item.user.lastName

buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING

submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
onButtonPress=() => this.onUnfollowPress(item)
/>
);


Now I have more than 2 statuses to handle, so the ternary operator here cannot be used. What will be the best approach to handle a situation like this?



I have 3 statuses now. 0, 1 and 2. According to the status I have to handle the following conditions.



 buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING









share|improve this question













In my react-native applications, i had written a code like this.



 return ( 
<PersonHandler
profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
firstName=item.user.firstName
lastName=item.user.lastName

buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING

submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
onButtonPress=() => this.onUnfollowPress(item)
/>
);


Now I have more than 2 statuses to handle, so the ternary operator here cannot be used. What will be the best approach to handle a situation like this?



I have 3 statuses now. 0, 1 and 2. According to the status I have to handle the following conditions.



 buttonBorderColor=item.status === 0 ? "#000000" : "#37CAFA"
buttonBackgroundColor=item.status === 0 ? null : "#37CAFA"
buttonTextColor=item.status === 0 ? "#000000" : "#FFFFFF"
buttonText=item.status === 0 ? USER_STATUS.REQUESTED : USER_STATUS.FOLLOWING






javascript react-native






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 3 hours ago









Shashika

432412




432412











  • You can use if else ladder or switch case for this purpose
    – Abinash Ghosh
    3 hours ago











  • You know you can write item.status === 0 ? A : (item.status === 1 ? B : C) right?
    – Rafalon
    3 hours ago










  • Nested ternaries are great. Read this stuff from Eric Elliot - medium.com/javascript-scene/…
    – Meet Zaveri
    3 hours ago
















  • You can use if else ladder or switch case for this purpose
    – Abinash Ghosh
    3 hours ago











  • You know you can write item.status === 0 ? A : (item.status === 1 ? B : C) right?
    – Rafalon
    3 hours ago










  • Nested ternaries are great. Read this stuff from Eric Elliot - medium.com/javascript-scene/…
    – Meet Zaveri
    3 hours ago















You can use if else ladder or switch case for this purpose
– Abinash Ghosh
3 hours ago





You can use if else ladder or switch case for this purpose
– Abinash Ghosh
3 hours ago













You know you can write item.status === 0 ? A : (item.status === 1 ? B : C) right?
– Rafalon
3 hours ago




You know you can write item.status === 0 ? A : (item.status === 1 ? B : C) right?
– Rafalon
3 hours ago












Nested ternaries are great. Read this stuff from Eric Elliot - medium.com/javascript-scene/…
– Meet Zaveri
3 hours ago




Nested ternaries are great. Read this stuff from Eric Elliot - medium.com/javascript-scene/…
– Meet Zaveri
3 hours ago












4 Answers
4






active

oldest

votes

















up vote
8
down vote



accepted










Sure you can use the ternary operator still, you just have to use it twice, for example:



 buttonBorderColor=
item.status === 0
? "#000000"
: item.status === 1
? "#37CAFA"
: "#FFFFFF" // if status is 2



That said, it's a bit uncomfortable to read - you might consider using an array indexed by status whose value is the color you want instead:



const colors = ["#000000", "#37CAFA", "#FFFFFF"]
// ...
buttonBorderColor= colors[item.status]





share|improve this answer




















  • All the answers would have solved the problem. But I think use of an array would be the most appropriate one. I achieved this through 3 arrays. Thanks CertainPerformance.
    – Shashika
    1 hour ago


















up vote
1
down vote













Use switch to handle three statuses. Nesting ternary operators is not a wise practice.





var buttonBorderColor,
buttonBackgroundColor,
buttonTextColor,
buttonText

switch (item.code)
case 0:
buttonBorderColor = '#000000'
buttonBackgroundColor = null
buttonTextColor = "#000000"
buttonText = USER_STATUS.REQUESTED
break;
case 1:
buttonBorderColor = '#37CAFA'
buttonBackgroundColor = '#37CAFA'
buttonTextColor = "#FFFFFF"
buttonText = USER_STATUS.FOLLOWING
break;
case 2:
buttonBorderColor = '#FFFFFF'
buttonBackgroundColor = '#FFFFFF'
buttonTextColor = "#FFFFFF"
buttonText = USER_STATUS.ELSE
break;
default:
break;






share|improve this answer



























    up vote
    1
    down vote













    You can use this way



    buttonBorderColor=item.status === 0 ? "#000000" : (item.status === 1 ? "#000001" : "#37CAFA")


    or you can use if else ladder



    if (item.status === 0) 
    buttonBorderColor = '#000000'
    buttonBackgroundColor = null
    buttonTextColor = "#000000"
    buttonText = USER_STATUS.REQUESTED
    else if (item.status === 1)
    // do something
    else
    // do something






    share|improve this answer





























      up vote
      1
      down vote













      You can do it like this:



      const pickValue = (status, v1, v2, v3) => 
      status === 0
      ? v1
      : status === 1
      ? v2
      : v3;

      return (
      <PersonHandler
      profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
      firstName=item.user.firstName
      lastName=item.user.lastName

      buttonBorderColor=pickValue(item.status, "#000000", "#37CAFA", null)
      buttonBackgroundColor=pickValue(item.status, null, "#37CAFA", null)
      buttonTextColor=pickValue(item.status, "#000000", "#FFFFFF", null)
      buttonText=pickValue(item.status, USER_STATUS.REQUESTED, USER_STATUS.FOLLOWING, null)

      submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
      onButtonPress=() => this.onUnfollowPress(item)
      />
      );





      share|improve this answer




















        Your Answer





        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: true,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52326218%2fternary-operator-alternatives-for-more-than-2-values%23new-answer', 'question_page');

        );

        Post as a guest






























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        8
        down vote



        accepted










        Sure you can use the ternary operator still, you just have to use it twice, for example:



         buttonBorderColor=
        item.status === 0
        ? "#000000"
        : item.status === 1
        ? "#37CAFA"
        : "#FFFFFF" // if status is 2



        That said, it's a bit uncomfortable to read - you might consider using an array indexed by status whose value is the color you want instead:



        const colors = ["#000000", "#37CAFA", "#FFFFFF"]
        // ...
        buttonBorderColor= colors[item.status]





        share|improve this answer




















        • All the answers would have solved the problem. But I think use of an array would be the most appropriate one. I achieved this through 3 arrays. Thanks CertainPerformance.
          – Shashika
          1 hour ago















        up vote
        8
        down vote



        accepted










        Sure you can use the ternary operator still, you just have to use it twice, for example:



         buttonBorderColor=
        item.status === 0
        ? "#000000"
        : item.status === 1
        ? "#37CAFA"
        : "#FFFFFF" // if status is 2



        That said, it's a bit uncomfortable to read - you might consider using an array indexed by status whose value is the color you want instead:



        const colors = ["#000000", "#37CAFA", "#FFFFFF"]
        // ...
        buttonBorderColor= colors[item.status]





        share|improve this answer




















        • All the answers would have solved the problem. But I think use of an array would be the most appropriate one. I achieved this through 3 arrays. Thanks CertainPerformance.
          – Shashika
          1 hour ago













        up vote
        8
        down vote



        accepted







        up vote
        8
        down vote



        accepted






        Sure you can use the ternary operator still, you just have to use it twice, for example:



         buttonBorderColor=
        item.status === 0
        ? "#000000"
        : item.status === 1
        ? "#37CAFA"
        : "#FFFFFF" // if status is 2



        That said, it's a bit uncomfortable to read - you might consider using an array indexed by status whose value is the color you want instead:



        const colors = ["#000000", "#37CAFA", "#FFFFFF"]
        // ...
        buttonBorderColor= colors[item.status]





        share|improve this answer












        Sure you can use the ternary operator still, you just have to use it twice, for example:



         buttonBorderColor=
        item.status === 0
        ? "#000000"
        : item.status === 1
        ? "#37CAFA"
        : "#FFFFFF" // if status is 2



        That said, it's a bit uncomfortable to read - you might consider using an array indexed by status whose value is the color you want instead:



        const colors = ["#000000", "#37CAFA", "#FFFFFF"]
        // ...
        buttonBorderColor= colors[item.status]






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        CertainPerformance

        50k142747




        50k142747











        • All the answers would have solved the problem. But I think use of an array would be the most appropriate one. I achieved this through 3 arrays. Thanks CertainPerformance.
          – Shashika
          1 hour ago

















        • All the answers would have solved the problem. But I think use of an array would be the most appropriate one. I achieved this through 3 arrays. Thanks CertainPerformance.
          – Shashika
          1 hour ago
















        All the answers would have solved the problem. But I think use of an array would be the most appropriate one. I achieved this through 3 arrays. Thanks CertainPerformance.
        – Shashika
        1 hour ago





        All the answers would have solved the problem. But I think use of an array would be the most appropriate one. I achieved this through 3 arrays. Thanks CertainPerformance.
        – Shashika
        1 hour ago













        up vote
        1
        down vote













        Use switch to handle three statuses. Nesting ternary operators is not a wise practice.





        var buttonBorderColor,
        buttonBackgroundColor,
        buttonTextColor,
        buttonText

        switch (item.code)
        case 0:
        buttonBorderColor = '#000000'
        buttonBackgroundColor = null
        buttonTextColor = "#000000"
        buttonText = USER_STATUS.REQUESTED
        break;
        case 1:
        buttonBorderColor = '#37CAFA'
        buttonBackgroundColor = '#37CAFA'
        buttonTextColor = "#FFFFFF"
        buttonText = USER_STATUS.FOLLOWING
        break;
        case 2:
        buttonBorderColor = '#FFFFFF'
        buttonBackgroundColor = '#FFFFFF'
        buttonTextColor = "#FFFFFF"
        buttonText = USER_STATUS.ELSE
        break;
        default:
        break;






        share|improve this answer
























          up vote
          1
          down vote













          Use switch to handle three statuses. Nesting ternary operators is not a wise practice.





          var buttonBorderColor,
          buttonBackgroundColor,
          buttonTextColor,
          buttonText

          switch (item.code)
          case 0:
          buttonBorderColor = '#000000'
          buttonBackgroundColor = null
          buttonTextColor = "#000000"
          buttonText = USER_STATUS.REQUESTED
          break;
          case 1:
          buttonBorderColor = '#37CAFA'
          buttonBackgroundColor = '#37CAFA'
          buttonTextColor = "#FFFFFF"
          buttonText = USER_STATUS.FOLLOWING
          break;
          case 2:
          buttonBorderColor = '#FFFFFF'
          buttonBackgroundColor = '#FFFFFF'
          buttonTextColor = "#FFFFFF"
          buttonText = USER_STATUS.ELSE
          break;
          default:
          break;






          share|improve this answer






















            up vote
            1
            down vote










            up vote
            1
            down vote









            Use switch to handle three statuses. Nesting ternary operators is not a wise practice.





            var buttonBorderColor,
            buttonBackgroundColor,
            buttonTextColor,
            buttonText

            switch (item.code)
            case 0:
            buttonBorderColor = '#000000'
            buttonBackgroundColor = null
            buttonTextColor = "#000000"
            buttonText = USER_STATUS.REQUESTED
            break;
            case 1:
            buttonBorderColor = '#37CAFA'
            buttonBackgroundColor = '#37CAFA'
            buttonTextColor = "#FFFFFF"
            buttonText = USER_STATUS.FOLLOWING
            break;
            case 2:
            buttonBorderColor = '#FFFFFF'
            buttonBackgroundColor = '#FFFFFF'
            buttonTextColor = "#FFFFFF"
            buttonText = USER_STATUS.ELSE
            break;
            default:
            break;






            share|improve this answer












            Use switch to handle three statuses. Nesting ternary operators is not a wise practice.





            var buttonBorderColor,
            buttonBackgroundColor,
            buttonTextColor,
            buttonText

            switch (item.code)
            case 0:
            buttonBorderColor = '#000000'
            buttonBackgroundColor = null
            buttonTextColor = "#000000"
            buttonText = USER_STATUS.REQUESTED
            break;
            case 1:
            buttonBorderColor = '#37CAFA'
            buttonBackgroundColor = '#37CAFA'
            buttonTextColor = "#FFFFFF"
            buttonText = USER_STATUS.FOLLOWING
            break;
            case 2:
            buttonBorderColor = '#FFFFFF'
            buttonBackgroundColor = '#FFFFFF'
            buttonTextColor = "#FFFFFF"
            buttonText = USER_STATUS.ELSE
            break;
            default:
            break;







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 3 hours ago









            Geethu Jose

            948621




            948621




















                up vote
                1
                down vote













                You can use this way



                buttonBorderColor=item.status === 0 ? "#000000" : (item.status === 1 ? "#000001" : "#37CAFA")


                or you can use if else ladder



                if (item.status === 0) 
                buttonBorderColor = '#000000'
                buttonBackgroundColor = null
                buttonTextColor = "#000000"
                buttonText = USER_STATUS.REQUESTED
                else if (item.status === 1)
                // do something
                else
                // do something






                share|improve this answer


























                  up vote
                  1
                  down vote













                  You can use this way



                  buttonBorderColor=item.status === 0 ? "#000000" : (item.status === 1 ? "#000001" : "#37CAFA")


                  or you can use if else ladder



                  if (item.status === 0) 
                  buttonBorderColor = '#000000'
                  buttonBackgroundColor = null
                  buttonTextColor = "#000000"
                  buttonText = USER_STATUS.REQUESTED
                  else if (item.status === 1)
                  // do something
                  else
                  // do something






                  share|improve this answer
























                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    You can use this way



                    buttonBorderColor=item.status === 0 ? "#000000" : (item.status === 1 ? "#000001" : "#37CAFA")


                    or you can use if else ladder



                    if (item.status === 0) 
                    buttonBorderColor = '#000000'
                    buttonBackgroundColor = null
                    buttonTextColor = "#000000"
                    buttonText = USER_STATUS.REQUESTED
                    else if (item.status === 1)
                    // do something
                    else
                    // do something






                    share|improve this answer














                    You can use this way



                    buttonBorderColor=item.status === 0 ? "#000000" : (item.status === 1 ? "#000001" : "#37CAFA")


                    or you can use if else ladder



                    if (item.status === 0) 
                    buttonBorderColor = '#000000'
                    buttonBackgroundColor = null
                    buttonTextColor = "#000000"
                    buttonText = USER_STATUS.REQUESTED
                    else if (item.status === 1)
                    // do something
                    else
                    // do something







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 3 hours ago

























                    answered 3 hours ago









                    Abinash Ghosh

                    312111




                    312111




















                        up vote
                        1
                        down vote













                        You can do it like this:



                        const pickValue = (status, v1, v2, v3) => 
                        status === 0
                        ? v1
                        : status === 1
                        ? v2
                        : v3;

                        return (
                        <PersonHandler
                        profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
                        firstName=item.user.firstName
                        lastName=item.user.lastName

                        buttonBorderColor=pickValue(item.status, "#000000", "#37CAFA", null)
                        buttonBackgroundColor=pickValue(item.status, null, "#37CAFA", null)
                        buttonTextColor=pickValue(item.status, "#000000", "#FFFFFF", null)
                        buttonText=pickValue(item.status, USER_STATUS.REQUESTED, USER_STATUS.FOLLOWING, null)

                        submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
                        onButtonPress=() => this.onUnfollowPress(item)
                        />
                        );





                        share|improve this answer
























                          up vote
                          1
                          down vote













                          You can do it like this:



                          const pickValue = (status, v1, v2, v3) => 
                          status === 0
                          ? v1
                          : status === 1
                          ? v2
                          : v3;

                          return (
                          <PersonHandler
                          profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
                          firstName=item.user.firstName
                          lastName=item.user.lastName

                          buttonBorderColor=pickValue(item.status, "#000000", "#37CAFA", null)
                          buttonBackgroundColor=pickValue(item.status, null, "#37CAFA", null)
                          buttonTextColor=pickValue(item.status, "#000000", "#FFFFFF", null)
                          buttonText=pickValue(item.status, USER_STATUS.REQUESTED, USER_STATUS.FOLLOWING, null)

                          submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
                          onButtonPress=() => this.onUnfollowPress(item)
                          />
                          );





                          share|improve this answer






















                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            You can do it like this:



                            const pickValue = (status, v1, v2, v3) => 
                            status === 0
                            ? v1
                            : status === 1
                            ? v2
                            : v3;

                            return (
                            <PersonHandler
                            profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
                            firstName=item.user.firstName
                            lastName=item.user.lastName

                            buttonBorderColor=pickValue(item.status, "#000000", "#37CAFA", null)
                            buttonBackgroundColor=pickValue(item.status, null, "#37CAFA", null)
                            buttonTextColor=pickValue(item.status, "#000000", "#FFFFFF", null)
                            buttonText=pickValue(item.status, USER_STATUS.REQUESTED, USER_STATUS.FOLLOWING, null)

                            submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
                            onButtonPress=() => this.onUnfollowPress(item)
                            />
                            );





                            share|improve this answer












                            You can do it like this:



                            const pickValue = (status, v1, v2, v3) => 
                            status === 0
                            ? v1
                            : status === 1
                            ? v2
                            : v3;

                            return (
                            <PersonHandler
                            profilePicture=item.user.profileImage ? uri: item.user.profileImage : DefaultUser
                            firstName=item.user.firstName
                            lastName=item.user.lastName

                            buttonBorderColor=pickValue(item.status, "#000000", "#37CAFA", null)
                            buttonBackgroundColor=pickValue(item.status, null, "#37CAFA", null)
                            buttonTextColor=pickValue(item.status, "#000000", "#FFFFFF", null)
                            buttonText=pickValue(item.status, USER_STATUS.REQUESTED, USER_STATUS.FOLLOWING, null)

                            submitting=unfollowIsInProgress && item._id === unfollowingPerson._id
                            onButtonPress=() => this.onUnfollowPress(item)
                            />
                            );






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 3 hours ago









                            cezn

                            58315




                            58315



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52326218%2fternary-operator-alternatives-for-more-than-2-values%23new-answer', 'question_page');

                                );

                                Post as a guest













































































                                Comments

                                Popular posts from this blog

                                What does second last employer means? [closed]

                                List of Gilmore Girls characters

                                Confectionery