Re: Check null or 0
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Check null or 0

From: web.dev <web.dev.cs@gmail.com>
Date: Mon Feb 27 2006 - 19:42:36 CET

staeri@gmail.com wrote:
> I'm using the following code to create a sum:
>
> forecast = forecast + eval(f[i].value);

The use of eval is most often misused and unnecessary.

Try the following to create your sum:

forecast += +f[i].value;
Received on Mon May 1 03:39:59 2006