Ternary Operator in JavaScript With Multiple Expressions?

后端 未结 6 1997
再見小時候
再見小時候 2021-01-17 14:29
the_styles ? the_styles.appendTo(\'head\'); the_styles=null : the_styles = $(\'.stylesheet\').detach();

Obviously, this isn\'t valid. Notice the \"

6条回答
  •  情话喂你
    2021-01-17 14:59

    the_styles ? the_styles.appendTo('head') : the_styles = $('.stylesheet').detach();
    

    you dont need to null it if your overwriting it !

提交回复
热议问题