week变量只是用json构建的多维数组的表示形式,我使用相同的方法(不是多维的)使用其他数组,它们可以正常工作。
数组而不是0、1、2、3,...具有'monday','thursday',...具有第一级的名称。
Object.keys
给出一个错误,指出长度和移位是没有功能的。
答案 0 :(得分:1)
我怀疑您想这样做:
Generating app in D:\programmierung\libgdx\test
Executing 'D:\programmierung\libgdx\test/gradlew.bat clean --no-daemon eclipse afterEclipseImport'
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.6/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
:core:clean
:desktop:clean UP-TO-DATE
:html:clean UP-TO-DATE
:eclipseProject
:eclipse
:core:eclipseClasspath
:core:eclipseJdt
:core:eclipseProject
:core:eclipse
:desktop:eclipseClasspath
:desktop:eclipseJdt
:desktop:eclipseProject
:desktop:eclipse
:html:eclipseClasspath
:html:eclipseJdt
:html:eclipseProject
:html:eclipseWtpComponent
:html:eclipseWtpFacet
:html:eclipseWtp
:html:generateGdt UP-TO-DATE
:core:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:compileJava'.
> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_201 contains a valid JDK installation.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 12s
18 actionable tasks: 15 executed, 3 up-to-date
Done!
To import in Eclipse: File -> Import -> General -> Existing Projects into Workspace
To import to Intellij IDEA: File -> Open -> YourProject.ipr
但是您的json对象是错误的(从语法上和结构上)。
答案 1 :(得分:0)
使用jQuery解决
$.each(week, function(key, val){
console.log(key);
for (var i = 0; i < val.length; i++){
console.log(val);
}
});