Question: While parsing the inputs i came across this behaviour of javascript

if you parse a number 

```
console.log(parseFloat('562.0') ? 'true' : 'false') 
console.log(parseInt('562') ? 'true' : 'false') 

```

It returns true, but if i parse 0 

```
console.log(parseFloat('0.00') ? 'true' : 'false') 
console.log(parseInt('0') ? 'true' : 'false') 

```

it returns false

can any one please explain why this happens ??

Answer: 
it doesent return **boolean false** it return **number 0** in ternary operator you compare with 0. **0 is false**
0 and 1 is boolean. <http://en.wikipedia.org/wiki/Boolean>

```
console.log((true)+0); // 1
console.log((false)+0); // 0

```

Zero is the only number returns false.

```
console.log((1) ? "true" : "false"); //true
console.log((0) ? "true" : "false"); //false

```