j.PushIfUnique

PHOTO EMBED

Wed Sep 22 2021 13:46:15 GMT+0000 (UTC)

Saved by @rick_m #javascript

function PushIfUnique (arr, element) {
    if (!arr.includes(element)) {
        arr.push(element);
    }
};
content_copyCOPY

Add to array if not in already in array