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
Post a Comment