Javascript plus operator not works with ternary if else

前端 未结 2 1671
感动是毒
感动是毒 2021-01-27 07:51

Hi this is my js code.

var a = \' and have \' + $(\'#module_product_review_star_1 .pdp-link\')[1] ? $(\'#module_product_review_star_1 .p         


        
2条回答
  •  情书的邮戳
    2021-01-27 08:16

    Ternary has this pattern:

    condition ? do if true : do if false;
    


    so in your case condition is

    ' and have ' + $('#module_product_review_star_1 .pdp-link')[1] 
    

提交回复
热议问题