Does anyone know how I can make my array choose four different options that go under different variables? Now, I have an array with six entities and a function that chooses four of those options and assigns it a variable, but there is the possibility that there will be repeats.
var colors = ['#4286f4', '#e2f442', '#f48c41', '#41f4f4', '#dd3b3b', '#7a6f6f']
window.colorOne = '';
window.colorTwo = '';
window.colorThree = '';
window.colorFour = '';
function beginAndGetCombo(){
window.colorOne = colors[Math.floor(Math.random() * colors.length)];
window.colorTwo = colors[Math.floor(Math.random() * colors.length)];
window.colorThree = colors[Math.floor(Math.random() * colors.length)];
window.colorFour = colors[Math.floor(Math.random() * colors.length)];
}
<input type=button value='Get Colors' onclick='beginAndGetCombo()'>