Q:

How do I stop the first call of a function from executing if the function is called again?

I have a section of DIV elements in HTML that are a set of cards. onmouseenter, depending on the card you're on, the cards animate to move out of the way in order to view the cards underneath (They're stacked on top of eachother and offset to actually allow a mouseenter). 
The problem is that if I move too fast, the function begins to execute both the element I moved fast over, and the element that the mouse is currently on. It becomes a loop and the card animations begin to flash repeatedly. 
What needs to happen, is if I move too fast over an element and move to the next, the element that the mouse is actually on needs to trigger, and not the element that I moved quickly over. Here's the functions that control both onleave and enter:
var siblings = [];
var siblingsLen;

function toggleCards(objId) {
  var grabId = objId.id;
  let checkPos = document.getElementById(grabId).previousElementSibling;
  let i = 0;

  if (checkPos == null) {
    return;
  } else {
    for (i = 0;; i++) {
      if (i == 0) {
        siblings.push(document.getElementById(grabId).previousElementSibling);
      } else {
        siblings.push(document.getElementById(siblings[i - 1].id).previousElementSibling);
      }
      if (siblings[i].previousElementSibling == null) {
        siblingsLen = siblings.length;
        break;
      }
    }
  }

  for (i = 0; i < siblingsLen; i++) {
    document.getElementById(siblings[i].id).classList.add('cardAnimationForwards');
    if (document.getElementById(siblings[i].id).classList.contains('cardAnimationBackwards')) {
      document.getElementById(siblings[i].id).classList.remove('cardAnimationBackwards');
    }
  }
}

function toggleCardsLeave() {
  for (i = 0; i < siblingsLen; i++) {
    document.getElementById(siblings[i].id).classList.remove('cardAnimationForwards');
    document.getElementById(siblings[i].id).classList.add('cardAnimationBackwards');
  }
  siblingsLen = 0;
  siblings = [];
}

Also, I've only ever done coding as a hobby, and not in classes or anything, so if there's anything you see that you could give me suggestions on, that'd be great! Thank you for your time, I greatly appreciate it.

A:

Aa @SaurabhGhewari stated, you should use debounce or throttle methods. Lodash is a great library, i recommend it, but since i see you are using only javascript.
From this tutorial: https://davidwalsh.name/javascript-debounce-function
Try adding this function to your code:
function debounce(func, wait, immediate) {
    var timeout;
    return function() {
        var context = this, args = arguments;
        var later = function() {
            timeout = null;
            if (!immediate) func.apply(context, args);
        };
        var callNow = immediate && !timeout;
        clearTimeout(timeout);
        timeout = setTimeout(later, wait);
        if (callNow) func.apply(context, args);
    };
};

And in your code 
var toggleCards = debounce(function(object) {
    // All the code from your function
}, 250);

Change the time parameter according to your needs.

