4 ms·
Yeah, "!!variable" works, and in my case I used ".length > 0". Boolean(variable) works too. It's just unfortunate when you're assuming that the expression or ty
by nawitus 12y ago
Yeah, "!!variable" works, and in my case I used ".length > 0". Boolean(variable) works too. It's just unfortunate when you're assuming that the expression or typecasting works like in JavaScript, and then AngularJS had to invent these unnecessary rules that make no sense. JavaScript's type coercion is tricky enough, you don't need to make it worse.