如何在对象数组上使用 jQuery.each() 循环

Sim*_*mes 1 javascript arrays jquery json loops

我有这个对象数组,如何使用 jQuery.each() 遍历它?

大批
(
    [0] => stdClass 对象
        (
            [id] => 1
            [parent_cat_id] => 1
            [child_cat_name] => Java
            [状态] => 1
            [日期] => 2016-09-11 01:26:00
        )

    [1] => stdClass 对象
        (
            [id] => 2
            [parent_cat_id] => 1
            [child_cat_name] => JavaScript
            [状态] => 1
            [日期] => 2016-09-11 01:26:00
        )

    [2] => stdClass 对象
        (
            [id] => 3
            [parent_cat_id] => 1
            [child_cat_name] => HTML
            [状态] => 1
            [日期] => 2016-09-11 01:26:00
        )

    [3] => stdClass 对象
        (
            [id] => 4
            [parent_cat_id] => 1
            [child_cat_name] => PHP
            [状态] => 1
            [日期] => 2016-09-11 01:26:00
        )

    [4] => stdClass 对象
        (
            [id] => 5
            [parent_cat_id] => 1
            [child_cat_name] => Python
            [状态] => 1
            [日期] => 2016-09-11 01:26:00
        )

    [5] => stdClass 对象
        (
            [id] => 6
            [parent_cat_id] => 1
            [child_cat_name] => 红宝石
            [状态] => 1
            [日期] => 2016-09-11 01:26:00
        )

)

我正在尝试使用这个 -

$.each( data, function( key, value ) {
    console.log( value );
});
Run Code Online (Sandbox Code Playgroud)

这给了我以下错误 -

类型错误:无效的“in”操作数 e

Dar*_*din 5

你的数组有奇怪的格式。看这个例子:

        var data = [    
            {text: "hello"},
            {text: "good bye"},
            {text: "Hello again"}       
        ]

        $.each( data, function( key, value ) {
            console.log( value.text );
        });
Run Code Online (Sandbox Code Playgroud)