function generateOptions(yAlignments, xAlignments) {
    const allOptions = document.createDocumentFragment();

    yAlignments.forEach(y => {
        let optionValue = y;

        if (xAlignments) {
            xAlignments.forEach(x => {
                optionValue = y + ' ' + x;
                generateOption(optionValue);
            });
        } else {
            generateOption(optionValue);
        }

    });

    function generateOption(value) {
        let option = document.createElement('option');
        option.text = option.value = value;
        allOptions.appendChild(option);
    }

    return allOptions;
}
@param {string[]} yAlignments
@param {string[]} [xAlignments]