JSFiddle - React, Tailwind, and code Playground

HTML

<div id="output"></div>

JavaScript

var Palette = function() {
    this.colors = ["red", "green", "blue"];
    this.getColorCombinations = function() {
        var combos = [];
        var self = this
        self.colors.forEach(function(a) {
            self.colors.forEach(function(b) {
                if(a !== b) {
                    combos.push([a, b]);
                }
            });
        });
        return combos;
    };
}

var p = new Palette();
document.getElementById('output').innerHTML = JSON.stringify(p.getColorCombinations());