how to fix jslint The '&&' subexpression should be wrapped in parens error

前端 未结 3 1170
误落风尘
误落风尘 2021-01-06 06:20

I put everything in parentheses but code below still throws error in jslint:

Problem at line 5 character 104: The \'&&\' subexpression should be wrap         


        
3条回答
  •  死守一世寂寞
    2021-01-06 07:13

    I think it wants this:

        if (((typeof (c1) === 'string') && (typeof (c2) === 'string') && (c1 !== null) && (c2 !== null)) && ((c1.trim()) === '') || ((c2.trim()) !== '')) {
    

    wrap the 4 anded expressions on the left of the && at 100.

提交回复
热议问题