For which version of javascript are you writing this application? I'm not familiar with "int" being a valid javascript keyword.
Anyways, the statement means:
Create a (n integer) variable called "newSize". If the value stored in the variable "size" is greater than 10 THEN store in "newSize" value 10. OTHERWISE (ELSE) store in "newSize" the value that is currently stored in "size".
It is a shortcut for the following code snippet:
if(size>10)
{
int newSize = 10
}
else
{
int newSize = size
}
Note well, I'm not sure what this "int" business is all about.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.