This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getObjectIndex (array, key, term) { | |
return array.indexOf(array.find(it => it[key] === term)) | |
} | |
// Example: find the index of the object where object.foo == 'apple' | |
const myArray = [ | |
{ | |
'foo': 'foo', | |
'bar': 'bar', | |
'baz': 'baz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for fun | |
// add the "annoying" class to anything to give your friends a seizure. | |
// see it in action: | |
// http://codepen.io/mmcbride1007/pen/QNMWpe | |
.annoying { | |
animation: pulse .2s infinite; | |
} | |
@keyframes pulse { |
NewerOlder