Code Improvement/Insight: Should I have approached these functions differently? Animations using Javascript
You can reduce this code down to one function by using default arguments.

function ani(p, reverse=false){
    let element = p.target.id;
    let scale = 2;
    if (reverse)
        scale = 1;
    anime({
        targets: '#'+ element,
        scale: scale,
    })
    return element;
}


Also, don't forget your semicolons ;-P