Is there any function in jQuery that is equivalent to PHP's array_column()?

前端 未结 6 1342
轻奢々
轻奢々 2021-02-10 04:57

What is the equivalent to PHP\'s array_column() in jQuery? I need the data inside the array without looping, in the same way as in PHP.

6条回答
  •  抹茶落季
    2021-02-10 05:56

    You mean like this:

    var a = {};
    a['alfa'] = 0;
    a['beta'] = 1;
    
    alert(a['alfa']);
    

提交回复
热议问题