Tuesday, February 05, 2008

Working with Integers in javaScript

When you are working with numbers in javaScript, you cant use the plus operator as usual. the problem with plus operator is, it concadintes the two numbers considering them as strings.

so when ever you are using the plus operator for an number is javaScript you have to use the fuction Number() to convert the var element to a numerical number.

No comments: