Iterating Array of Objects in javascript

后端 未结 9 1429
闹比i
闹比i 2020-12-24 13:31

I am having an array that consists the objects with a key, value how can we iterate each object for caste and id.

[
    Object {
           


        
9条回答
  •  攒了一身酷
    2020-12-24 14:10

    Example code:

    var list = [
        { caste:"Banda",id:4},
        { caste:"Bestha",id:6},
    ];
        
    for (var i=0; i

    It's just an array, so, iterate over it as always.

提交回复
热议问题