key - IndexOf an associative array in javascript -


can tell me please how index of associative array??

for example index of key:".launchpad-plankovy"??

        var droppableclasses = [            {key:".stackdrop-plankovy", value:".card-plankovy"},             {key:".launchpad-plankovy", value:".card-plankovy"}         ]; 

with es6 can use findindex() this.

var droppableclasses = [{    key: ".stackdrop-plankovy",    value: ".card-plankovy"  }, {    key: ".launchpad-plankovy",    value: ".card-plankovy"  }];    var index = droppableclasses.findindex(function(e) {    return e.key == '.launchpad-plankovy';  })    console.log(index)


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -