Implementation of a shift operation for Set in JavaScript that emulates the one for arrays
Another way to do it is via the iterator function. 

function shifySet(set) {
    const first = set[Symbol.iterator]().next().value;
    set.delete(first);
    return first;
}


I was going to check if there was an item, but it seams pointless. Works the same as your function shifts the first entry, returning it, or undefined if not found.

I would make a slight change to your version

function shiftSet(set) {
    for (const res of set) {
        set.delete(res);
        return res
    }
}