var value=new Array(1024,768,250,480,540,800,600,933,700);
for(var i in value)
{
Log.Message((1+i)<5?(i):(i+1))
}
The result for this program:
01 11 21 31 41 51 61 71 81
seems weird, what I expexted is : 0 1 2 3 5 6 7 8 9
After debug found root cause is that:
for(var i in value)
here var i is treated as string later, NOT as intenger!
Correct Code should be:
var value=new Array(1024,768,250,480,540,800,600,933,700);
for(var i in value)
{
i=parseInt(i);
Log.Message((1+i)<5?(i):(i+1))
}
分享到:
相关推荐
Caused by: java.net.UnknownHostException: openapi.alipay.com
### 错误解析:Caused by: android.system.ErrnoException: write failed: ENOSPC (No space left 在Android开发过程中,可能会遇到“Caused by: android.system.ErrnoException: write failed: ENOSPC (No space ...
标题中的“Caused by: java.sql.SQLException: JZ0SJ: 没有在此数据库中发现元数据存取器信息。 请按 jConnect 文档中所述安装”是一个典型的错误信息,表明在尝试使用Java数据库连接(JDBC)驱动程序访问数据库时...
该文章主要讨论了一种名为"Rescue of a lysosomal storage disorder caused by Grn loss of function with a brain penetrant progranulin biologic"的研究成果,它涉及了神经退行性疾病,特别是与Grn基因功能丧失...
标题:“Software caused connection abort: recv failed” 描述:“Software caused connection abort: recv failed” 知识点解析: ### 背景介绍 “Software caused connection abort: recv failed”这一错误...
在Java应用程序运行过程中,"java.lang.OutOfMemoryError: PermGen space"错误是常见的一个问题,尤其是在使用Tomcat这样的Java应用服务器时。这个错误表明应用程序在 PermGen 区域(Permanent Generation)耗尽了...
Fixed a problem where the presence of the _OSI predefined control method within complex expressions could cause an internal compiler error. AcpiExec: Implemented full region support for multiple ...
Android Caused by: java.lang.ClassNotFoundException解决办法 出现问题: 08-13 18:29:22.924: E/AndroidRuntime(1875): Caused by: Java.lang.ClassNotFoundException:XXXXX in loader dalvik.system....
在这个特定的场景中,异常堆栈跟踪显示 `Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.Type`,这表明在运行时,系统无法找到`org.objectweb.asm.Type`这个类。`org.objectweb.asm` 是一个用于...
connection reset解决方案(亲测可用).md
异常:Caused by: java.lang.IllegalStateException: Method has too many Body parameters Caused by: java.lang.IllegalStateException: Method has too many Body parameters: public abstract ...
- Passing of invalid OPC Item IDs caused a memory leak of the driver's global memory. After the global memory was exhausted, the driver crashed. - Writing of string values failed when using ...
(a) the number of instances of relationships of that relationship type (b) the number of entity types involved in that relationship type (c) the number of relationships of that relationship type in...
本地hadoop程序bug ExitCodeException exitCode=-1073741701 case1.双击本地hadoop目录下的bin/winutils.exe 提示操作系统缺少 msvcr100.dll文件 case2.如过第一种情况不成功,则安装常用C++库合集(x86 + 64位)
An ISP earns its money by charging each of the the ISPs that connect to the IXP a relatively small fee, which may depend on the amount of traffic sent to or received from the IXP. 15. Google's ...
最后换了Tomcat8.5.54的才配置成功。下面就是我配置的过程,记录一下,与大家共勉。 1.首先公司的泛域名,运维给了ssl证书的文件包: 2.我们选取Tomcat的ssl证书,有jks文件和key的文件。 3....
在这个特定的场景中,异常堆栈跟踪显示了 `Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.Transformer`,这表明系统无法找到 `org.apache.commons.collections.Transformer` 类。...
SP-7098: Fixed a bug where re-sorting the list of code analysis issues caused all expanders to collapse (when grouping by issue type). SP-7131 : Fix crashes that occur when using a new licence.